Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Experts,
I am trying to achieve a functionality in Qlik Sense Sheet. i have a year Filter Pane in a sheet (Year-2015,2016,2017,2018), if a user select Jumping/Skipping a year (Selections Example -2015,2017,2018..Skipping 2016 OR Selections Example -2015,2018..Skipping 2016,2017 IT SHOULD SHOW ERROR),
My CHART should show error, we can achieve the error message if nothing is selected using the if condition with Something like ""If(len(GetFieldSelections(Year))=0,'Error')"" but wondering how we can deal with the Jumping/Skipping Scenarios like above.
Thanks
Howdy Ankithreddy!
This is a fun problem! You can do =if(min(Year) + (getselectedcount(Year)-1) <> max(Year), 'Error', '')
The math works like this 2014, 2015, 2016, 2017.
Min(Year) = 2014
Max(Year) = 2017
GetSelectedCount(Year) = 4
2014 + (4 - 1) = 2017. No error will be shown.
Hope this helps!
Kind regards,
Yogi Achilleos
Howdy Ankithreddy!
This is a fun problem! You can do =if(min(Year) + (getselectedcount(Year)-1) <> max(Year), 'Error', '')
The math works like this 2014, 2015, 2016, 2017.
Min(Year) = 2014
Max(Year) = 2017
GetSelectedCount(Year) = 4
2014 + (4 - 1) = 2017. No error will be shown.
Hope this helps!
Kind regards,
Yogi Achilleos
Quarters are even more fun! Lol but you need to do some script work.
Temp:
Load Distinct
Year,
Quarter
Resident Calendar
Order by Year, Quarter Asc;
Left Join (Calendar)
Load *,
rowno() as QuarterID
Resident Temp;
Drop Table Temp;
Then you can use a similar formula as the one above for year but on QuarterID! (You'll have to use getPossibleCount() instead of getSelectedCount() )
Hope that helps.
Kind regards,
Yogi Achilleos