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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use of Set Analysis not displaying correctly

Hi,

I am trying to use set analysis to display a figure for a previous 'run':

=sum({$<RunOrderNumber={$(=319)}>} AMOUNT )

However, when I display this within a chart straight table it displays the total amount and not an amount for each customer (which is the only dimension in the table). Could anyone help me on why this is happening? I have tried several options with no luck.

Thanks

4 Replies
Not applicable
Author

Have you attempted to use aggregation to deal with the issue and force it through?

=aggr(sum($<RunOrderNumber={$(=319)}>} AMOUNT), [Customer])

Also, you may want to change the way in which you select the set, this may also be causing the issue

=sum($<RunOrderNumber={319}>} AMOUNT)

This may or may not work depending on the data structure, have I had success with it though in the past when I encountered a similar problem

Not applicable
Author

Peter,

Thank you for your reply. When I use aggr() this column displays a zero. Also when I use your other suggestion, the result still says the same.

Thanks

johnw
Champion III
Champion III

A set is built once for an entire table, not once per row of the table. That said, I don't see why the expression you gave would misbehave, because it does not appear to use the chart's dimension in it, so it should still give you distinct values for each customer. To debug, I'd probably need a working (well, failing) example.

Not applicable
Author

I tested this without using a variable in the table chart and this works fine. So it looks to be when I reference the variable as an expression in the chart, the values do not get associated to the customer correctly. Having the set analysis formula in the chart without the use of a variable works perfectly. Has anyone come across this before?