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: 
Not applicable

Greater than or equal to a variable (set analysis)

Hi,

I am trying to find the set analysis that will only produce a value when a date field is greater to or equal to a variable I have set.

Is there a way to make the set only look at values greater to or equal to the variable.


DATE < = {$(#vMaxQuarter_Date)} -- getting blank values how we can use it correctly

Thank You!

5 Replies
sunny_talwar

Try it like this:

{<DATE = {'<=$(#vMaxQuarter_Date)'}>}

Best,

Sunny

ramoncova06
Specialist III
Specialist III

Single quotes for advanced search expressions are considered a bug and one day might not work anymore so use what sunindia gave but with " instead of '

{<DATE = {"<=$(#vMaxQuarter_Date)"}>}

sunny_talwar

I think single quotes seem to work almost every time except when there is a need to use another single quote within the set analysis. For instance:

{<Date = {"<= $(=Date(Max(Date), 'MM/DD/YYYY'))" }>} will work, but

{<Date = {'<= $(=Date(Max(Date), 'MM/DD/YYYY'))' }>} this won't work (Single quotes within single quotes will confuse QlikView. It will instead read first and second as beginning and end of qoutes and 3rd and 4th as another single quote combination.

HTH

Best,

Sunny

ramoncova06
Specialist III
Specialist III

I know they work but I have seen posts by HIC that mention this it is considered a bug

A search can be defined through double quotes. This way, field values that match the search string will be selected:

          Sum( {$<Date={"…"}>} Sales)

Do not use single quotes to initiate a search here! Single quotes should denote literals, i.e. explicit field values. (Yes, today single quotes work as a search, but this is a bug that one day will be fixed…)

Often a numeric search is made, defined by a leading relational operator. Then, field values will be selected based on a comparison:

in post A Primer on Set Analysis

sunny_talwar

Thank you RamonCova06 for pointing that out.

Best,

Sunny