Qlik Community

Qlik Sense Advanced Authoring

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

Announcements
See why Qlik is recognized as a Leader for the 10th year in a row – and discover how Qlik can help put your business in the lead. Get Report
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)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Variable Value not Displayed in 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)'

 

View solution in original post

4 Replies
Highlighted
Lauri
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.

Highlighted
Partner
Partner

Re: Variable Value not Displayed in Text Box

change if condition to
f(GetSelectedCount(TimeframeFilterDate)=1,$(vDateTo))
Highlighted
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
Highlighted
Partner
Partner

Re: Variable Value not Displayed in 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)'

 

View solution in original post