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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
DaanBrand
Contributor
Contributor

Problem with Set Analysis aggr max Date

Hi, all

I have a problem with Set Analysis.

I want to show the sum of [Aantal] when the THT_Datum = the Maximum THT_Datum per PartijNummer per Artikel.

I'm using the following expression;

Sum ({<THT_Datum = {"$(=aggr(nodistinct(max(THT_Datum)),PartijNummer,Artikel))"}>}Aantal)

When I have no selections made it will return only 0 values.

Knipsel1.PNG

If I make a selection based on one PartijNummer it will return the correct Values:

Knipsel2.PNG

I can solve it with an IF expression but i want to solve it in Set Analysis because I also need the data per Week.

Is there anyone who can help me?

Thank you very much in advance.

Daan

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

You could consider flagging the records where THT_Datum = the Maximum THT_Datum per PartijNummer per Artikel in your script. Then use this flag in your set expression to filter the data.

Set analysis is only evaluated once per chart, not per chart line / dimension line, so you won't get a correct evaluation of your date field modifier.

View solution in original post

2 Replies
swuehl
Champion III
Champion III

You could consider flagging the records where THT_Datum = the Maximum THT_Datum per PartijNummer per Artikel in your script. Then use this flag in your set expression to filter the data.

Set analysis is only evaluated once per chart, not per chart line / dimension line, so you won't get a correct evaluation of your date field modifier.

DaanBrand
Contributor
Contributor
Author

Thanks! That works!