Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In Qlik Sense I have a variable that contains the following:
$(vDateTo) -
If(GetSelectedCount(TimeframeFilterDate)=1,
If(GetFieldSelections(TimeframeFilterDate)='Previous week','$(vfDatePreviousWeekStart)',
If(GetFieldSelections(TimeframeFilterDate)='Previous month','$(vfDatePreviousMonthStart)',
If(GetFieldSelections(TimeframeFilterDate)='Previous 90 days','$(vfDatePrevious90DaysStart)',
If(GetFieldSelections(TimeframeFilterDate)='Previous 6 months','$(vfDatePrevious6MonthStart)',
If(GetFieldSelections(TimeframeFilterDate)='Previous 12 months','$(vfDatePrevious12MonthStart)'))))),
If('$(vFilterCheck)'='None',Date(Today()-32),Date(Min(DD_Date))))
If I put the above directly into a text box it works correctly. If I create a variable with the above and only include the variable in a text box it still works correctly. When I try to include it in an IF statement in the text box then it stops working:
If(GetSelectedCount(TimeframeFilterDate)=0,$(vDateTo))
The above returns a blank text box.
Ended up having to do two things to make this work.
1) I created a new variable called $(vDateToTable) that was just =$(vDateTo)
2) When I inserted the variable into the text box I slapped quotes around it: '$(vDateToTable)'
It looks like your If statement contradicts your variable, which only works when 1 selection of TimeframeFilterDate has been made.
why u have count "0'
If(GetSelectedCount(TimeframeFilterDate)=0,(=vDateTo))
try this
Ended up having to do two things to make this work.
1) I created a new variable called $(vDateToTable) that was just =$(vDateTo)
2) When I inserted the variable into the text box I slapped quotes around it: '$(vDateToTable)'