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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Total with parameter not working in Set Analysis

Dear All,

I have attached file. Just go thruogh the file , I want to show amount for Maximum Date for each ID wise.

For that i have written two expression in two diff chart.

FIRST IS AGGR (MAX(DATE), ID)

SECOND IS MAX(TOTAL<ID> DATE)

Both of above gives correct answer. But when i try to show AMOUNT by using above expressions then i got some different answer.

Means First Expression works only when i click some particular ID only otherwise nothing.

Second expression in Set Analysis gives the output for only One ID not for all ID because there TOTAL<ID> doesn't work properly.

It works as TOTAL.

Can anyone help me get the solution??????

3 Replies
Not applicable

=aggr(If([DATE]=max(total <[ID]>[DATE]),
[SUBID]
)
,[ID],[DATE]
)

Change [SUBID] to [DATE] in 2nd expression and [AMOUNT] in 3rd expression. The result here is different than what you said you wanted in the .qvd but you said you wanted the max date which is 3,2 not 3,3 like you said but I'm pretty sure this is what you actually want.

Not applicable

Forgot to mention put [ID] as dimension

Not applicable

I guess I could save you some trouble by saying that set analysis isn't going to work here. Set analysis calculates once per chart, not once per row (which is why it works if you select one ID). If you want the set to be something like today()-30 it will work fine, but if you want the set to be something like < (this specific ID's max date) it will not work but the date you want changes. Ask yourself "Is the answer to this set analysis going to be the same for every single row?" In this case, it is not, so you don't want to use set analysis.

Please correct me if I'm wrong as I'm not a QV pro (I guess I work in QV all day so I am technically a pro, but my point is that I've only used it for a couple months). I've fixed this same problem many times so I'm pretty sure this is good information.