Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
olivierbuchy
Contributor

Set Analysis, Dates and Variables

I want to use Set Analysis on a date but I seem to miss the correct formatting.


I load something like this :

LOAD

     date(@1) as DateExport,

     Ratio

FROM

(bla,bla...)


In my load script, I calculate the max value

SET vMaxDate = max({1} DateExport );


Later on in my charts I want to use this


=max({$ < DateExport={'$(vMaxDateVisites)'} >} Ratio)


which fails miserably but the following line works like a charm


=max({$ < DateExport={'19/04/2018'} >} Ratio)


What am doing wrong with my vMaxDate variable or Set Analysis syntax?

1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: Set Analysis, Dates and Variables

Hi,

Set Analysis doesn't work in script. You can use Max function directly in the measure expression something like this -

=max({$ < DateExport={"=$(=Max(DateExport))"} >} Ratio)

View solution in original post

4 Replies
wassim1988
New Contributor III

Re: Set Analysis, Dates and Variables

Hi Olivier,

i think that you are not using the same variable that u did declare no?

Digvijay_Singh
Honored Contributor III

Re: Set Analysis, Dates and Variables

Hi,

Set Analysis doesn't work in script. You can use Max function directly in the measure expression something like this -

=max({$ < DateExport={"=$(=Max(DateExport))"} >} Ratio)

View solution in original post

olivierbuchy
Contributor

Re: Set Analysis, Dates and Variables

Thanks this works.

Re: Set Analysis, Dates and Variables

I wonder if the set analysis is even working digvijay‌, you seem to have an extra parenthesis before $(

=max({$<DateExport={"=$(=Max(DateExport))"} >} Ratio)