Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to create a measure that uses a condition based on checking if the current date is part of the selected range. The selection does not have to be on the Date field, but also with other field (Year, Month, Quarter, YTD, MTD).
For example:
Date=03/10/24-03/14/24 --> Current Date is in the selected range.
Year=2024 --> Current Date is in the selected range.
Year=2024, Month=2 --> Current Date is not in the selected range.
Clear all selection --> Current Date is in the selected range (no selection was made so all dates are in the range).
Hope I was clear.
Thanks.
Isn't that automatic in Qlik?
-Rob
I need to write a condition that will perform a calculation based on the user's selections. If the current date is part of the selected range then measure X will be calculated, otherwise measure Y will be calculated. Both measures will perform the calculation correctly for the selected dates range, the question is which index will be displayed.
I think something along the lines of
if(Date = Only({$} Date), Sum({1} Sales), Sum({1} Margin)
In the mesures (Sum used as example here) you may want to use something other than {1}, perhaps instead using modifiers to ignore the date selection(s) -- depends on your requirement.
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
Sorry but I didn't understand how to set the condition. I also checked this Only function, but I couldn't find a solution.
I created a KPI that will display 1 if the current date is in the selected range, or 0 if not. I selecting only Year value, so if I select 2024 than I recieve 1, else 0.
Solution:
If(Max(Date) = Max({1} Date), ...)