Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Highlighted
Partner
Partner

Variable Value not Displayed in Text Box

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.

Labels (2)
3 Replies
laurischarf
Contributor III

Re: Variable Value not Displayed in Text Box

It looks like your If statement contradicts your variable, which only works when 1 selection of TimeframeFilterDate has been made.

Partner
Partner

Re: Variable Value not Displayed in Text Box

change if condition to
f(GetSelectedCount(TimeframeFilterDate)=1,$(vDateTo))
Channa
Valued Contributor III

Re: Variable Value not Displayed in Text Box

why u have count "0'

 

 

If(GetSelectedCount(TimeframeFilterDate)=0,(=vDateTo))

try this

Channa