Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bbergstrom
Partner - Creator II
Partner - Creator II

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
bbergstrom
Partner - Creator II
Partner - Creator II
Author

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
Lauri
Specialist
Specialist

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

dplr-rn
Partner - Master III
Partner - Master III

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

why u have count "0'

 

 

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

try this

Channa
bbergstrom
Partner - Creator II
Partner - Creator II
Author

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)'