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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting familiar with SET analysis

Hi Folks,

I am very much new to QlikView.

I am trying to achieve something like below:

I want to get maximum LastAccess(date) for the year 2014

=max({<Year(LastAccess)={'2014'}>}LastAccess)

For some reason this formula does not give any data back.

However when apply max(if(year(LastAccess)=2014,LastAccess)), it works.

Is there something I am missing?

Regards,

Tejas

4 Replies
sunny_talwar
MVP
MVP

You cannot use functions on the left hand side of your set analysis modifier:

=Max({<Year(LastAccess)={'2014'}>}LastAccess)


The best way would be to create a field in the script using LastAccess for Year and use that


Year(LastAccess) as Year


=Max({<Year = {'2014'}>} LastAccess)


UPDATE:

or if you don't want to change the script, then use a longer alternative:

=Max({<LastAccess = {"$(='>=' Date(MakeDate(2014, 01, 01), 'YourLastAccessFieldFormatHere') & '<=' & Date(MakeDate(2014, 12, 31), 'YourLastAccessFieldFormatHere'))"}>} LastAccess)

Anonymous
Not applicable
Author

Not applicable
Author

Thank you Sunny for you response.

Is it some kind of limitation? Do we have a document for such limitations?

Regards,

Tejas

sunny_talwar
MVP
MVP

I don't think I have seen a document for limitations, but you might find the attached useful as it guides you what are some things you can do with set analysis. I have not come across anything more comprehensive then what's attached on this topic.