Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
munomet
Contributor
Contributor

Create new variable

I have a problem while creating dynamic  values for variable input.

I set 1 variable (vDate1) with list of dates, and want this variable contain values from field REP_DATE_COMPARE only less than vDate1.

My code is :

=concat(distinct ({$<date([REP_DATE_COMPARE]) = {'<$(vDate1)'}>} date(REP_DATE_COMPARE)),'|')

What is wrong?

3 Replies
tm_burgers
Creator III
Creator III

what is the result of $(vDate1)? you say a list of dates...

 

the set expression formula you use will not work if your variable has more than one date value... 

 

munomet
Contributor
Contributor
Author

$(vDate1) is variable with 1 date, selected from the list in drop down variable input

tm_burgers
Creator III
Creator III

Ok, the other thing I would do is change your set expression to, switch the variable to fully calculate by wrapping it in $(= ) and swap the single quotes for double.

 

distinct ({$<[REP_DATE_COMPARE] = {"$(=$(vDate1))"}>} REP_DATE_COMPARE)

 

I wouldn't wrap your dimension with Date - use your autoCalendar field if you need the format.