2023 Apr 12 4:45 PM
I am trying to enable a multi-select function from the data model of my parameter in Tableau, but the code I use for my Oracle data models is not working. Does anyone know the HANA equivalent?
select trim(UPPER( regexp_substr(<Parameters.SAPProjectParameter>,'[^,]+',1,level))) from dual
connect by UPPER( regexp_substr(<Parameters.SAPProjectParameterr>,'[^,]+',1,level)) is not null))
Thank you in advance!
2023 Apr 12 4:45 PM
Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with Community Q&A, as the overview provides tips for preparing questions that draw responses from our members.
Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a Picture to your profile you encourage readers to respond.
2023 Apr 12 8:31 PM
jwalls1221
can we know what is the <Parameters.SAPProjectParameter> to be passed ?
2023 Apr 12 8:55 PM
Yes, this is a parameter in my Tableau workbook that the user selects on a dashboard which dictates which program the user would like to analyze. My goal is to allow the user to multi-select projects which is what I use the statement for in my other Tableau workbooks. However, the other workbook data models are Oracle-based, whereas this one is HANA-based.
Essentially, I'd like the statement to dictate that if multiple projects are selected in the SAPProjectParameter, these selections should be concatenated with a comma in between them. However, if a user only selects one project, it should only render data for that project with no augmentation to how it is being queried.
I tried to re-write it based on some changes I know would need to be made between Oracle and HANA and this is what I came up with, but I am still getting an error:
select trim(UPPER( substr_regexp(<Parameters.SAPProjectParameter>,'[^,]+',1,level))) from dummy
connect by UPPER( substr_regexp(<Parameters.SAPProjectParameter>,'[^,]+',1,level)) is not null))
2023 Apr 12 9:08 PM
SELECT TRIM(UPPER(SUBSTRING_INDEX(<Parameters.SAPProjectParameter>,',',1)))
FROM DUMMY
CONNECT BY SUBSTRING_INDEX(<Parameters.SAPProjectParameter>,',',1) IS NOT NULL
jwalls1221
thanks for the above reply... I am hoping this select will work in HANA but not sure on Parameters.SAPProjectParameter part.
2023 Apr 13 4:29 PM
When I use that code, I get the following error:
[SAP AG][LIBODBCHDB DLL][HDBODBC] Syntax error or access violation;257 sql syntax error: incorrect syntax near "SELECT": line 38 col 3 (at pos 2801)
Thoughts?
2023 Apr 18 2:42 PM