Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use greater than with variables and two (or more) modifiers?

Hello,

I have a varialbe vSelectedDate, with the numeric equivalent of the 15.05.2014 (41773).

I have this input:

DATE_FROMDATE_TOVALUE
01.01.200031.12.20104.2
01.01.201130.09.20123.5
01.10.201231.12.20135.1
01.01.201430.09.20147.2
01.10.201431.12.99991.3

I'd like to output the value valid for the date in the vSelectedDate variable. My expression looks like the following:

concat({<[DATE_FROM]={"<=$($(vSelectedDate))"},[DATE_TO]={">=$($(vSelectedDate))"}>}DISTINCT VALUE)

My output should look like this: 7.2 (since the 15.05.2014 is greater than green and lesser than orange)

But my output looks like this: 1.37.25.13.54.2 (So it's the concatination of all values possible)

I looked into following threads, but I can't quite figure out why it won't work.

Using Greater Than in Set Analysis

Set Analysis - Dates greater than a given number of days ago

Set analysis greater than less than

1 Solution

Accepted Solutions
krishna_2644
Specialist III
Specialist III

Try:

concat({<[DATE_FROM]={'<=$(=vSelectedDate)'},[DATE_TO]={'>=$(=vSelectedDate)'}>}DISTINCT VALUE)


if date format needed, then:

concat({<[DATE_FROM]={'<=$(=date(vSelectedDate'DD.MM.YYYY'))'},[DATE_TO]={'>=$(=date(vSelectedDate'DD.MM.YYYY'))'}>}DISTINCT VALUE)


View solution in original post

4 Replies
sunny_talwar

May be this:

=Concat({<[DATE_FROM]={"<=$(=Date($(vSelectedDate), 'DD.MM.YYYY'))"}, [DATE_TO]={">=$(=Date($(vSelectedDate), 'DD.MM.YYYY'))"}>} DISTINCT VALUE)

Update: Sample attached

krishna_2644
Specialist III
Specialist III

Try:

concat({<[DATE_FROM]={'<=$(=vSelectedDate)'},[DATE_TO]={'>=$(=vSelectedDate)'}>}DISTINCT VALUE)


if date format needed, then:

concat({<[DATE_FROM]={'<=$(=date(vSelectedDate'DD.MM.YYYY'))'},[DATE_TO]={'>=$(=date(vSelectedDate'DD.MM.YYYY'))'}>}DISTINCT VALUE)


Not applicable
Author

Thank you!

Not applicable
Author

Thank you very much!