Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

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!

Tags (1)
5 Replies

Re: Greater than or equal to a variable (set analysis)

Try it like this:

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

Best,

Sunny

ramoncova06
Valued Contributor III

Re: Greater than or equal to a variable (set analysis)

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)"}>}

Re: Greater than or equal to a variable (set analysis)

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
Valued Contributor III

Re: Greater than or equal to a variable (set analysis)

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

Re: Greater than or equal to a variable (set analysis)

Thank you RamonCova06 for pointing that out.

Best,

Sunny

Community Browser