Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I have island table for button selection, based on button selection expression will be calculated like (MTD, YTD etc...)
I have created variable like below and applied expression as mention below - This is working fine for me...
Expression: count(DISTINCT {<$(vCurrntYear )>} ID )
Same way I have applied in the Script
Expression: count(DISTINCT {<ABC>} ID ) - This is not working (is there any way to achieve)
Thanks in Advance!
Any reason you are doing it in script?, set expressions only work in front end charts. Are you trying to create variable having measure expressions in the script and then want to use them in the chart?
Can you share the exact script statements where things are not working?
Visually I'm facing optimization issue, so I have written in scripting level.
Calling ABC in this way is just a field and it won't be regarded as a valid set analysis. To get it to work you may try something like this:
count(DISTINCT {< $(=maxstring(ABC)) >} ID)
But IMO you won't increase the performance or simplifying your approach by moving the set analysis string from the UI to the script. If your calculation is too slow you will need optimizations to your data-model maybe by developing it in the direction of a star-scheme.
- Marcus
Adding to @marcus_sommer 's answer, which I agree with, you should consider scrapping your island table and using a variable instead. That might actually help performance. See: https://qlikviewcookbook.com/2015/06/the-impact-of-data-islands-on-cache-and-cpu/