Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Guys,
I'm new to Qlik Sense and have a question regarding Set Analysis using some embedded function.
I use some embedded functions to get the latest Calendar Year, from my Filter Pane as so:
SubField(GetFieldSelections([Calendar_Year_Nbr],',',GetSelectedCount([Calendar_Year_Nbr])),',',GetSelectedCount([Calendar_Year_Nbr]))
When I embed this formula in a table it returns the correct result (Single Year of: 2016) based on my selection criteria.
As in the screenshot below:
However when I embed the formula as part of a Set Analysis in a KPI it still returns results from multiple years (2015,2016)
Here is my Set Analysis formula:
count( distinct {$< Calendar_Year_Nbr = {"=$(= SubField(GetFieldSelections([Calendar_Year_Nbr],',',GetSelectedCount([Calendar_Year_Nbr])),',',GetSelectedCount([Calendar_Year_Nbr])))"}>} Dim_Case_DEX_Key)
Here is the a screenshot of the KPIs with the calculated KPI from above. (highlighted in yellow):
As you can see it still contains the aggregated result of 2015,2016 rather then just 2016.
Its should give the same result as the KPI "Hardcoded 2016" on the left 1.49M
Any help would be much appreciated.
Regards Anto
May be it is still a text field. Try this:
Count(DISTINCT {$< Calendar_Year_Nbr = {"=$(=Num#(SubField(GetFieldSelections([Calendar_Year_Nbr], ',', GetSelectedCount([Calendar_Year_Nbr])), ',', GetSelectedCount([Calendar_Year_Nbr]))))"}>} Dim_Case_DEX_Key)
Hey Sunny,
Thanks for this but it didn't seem to make a difference still gives me the aggregated results, if more than one year is selected.
Regards Anto
Would it be possible for you to share a sample to see the issue?
You won't have access to my Enterprise data source and file is saved
on Qlik Sense Enterprise server.
Do you want me to replicate this solution on Qlik desktop,
with just some dummy data ?
Regards Anto
What's wrong with using Max(Calendar_Year_Nbr) to get a single year value?
Hey Jonathan,
Tried that also gives me an aggregated result , also don't think it takes
into account the dynamic values I've selected