Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Ignore all selections but one

Hey there,

i have a chart that show's the total payments made for a project. What i want is the chart to do a sum on all the fields with that project_id ignoring all the selections but the project_id.

Atm im trying using set analisys but im not that good with it yet.

Any help would be appreciated.

Regards,

Juan Pedro

10 Replies
Gysbert_Wassenaar

You need to add the dimensions  that should be ignored to the expression like this:

sum(<Field1=,Field2=, .... >  total_payments)


talk is cheap, supply exceeds demand
Not applicable
Author

Hey there and thank you for the answer,

ye i knew this kind of approch but like i dont want to insert all my possibles dimensions in the expression.

I was wondering if something like consider only this kind of selection was possible.

Regards,

Juan Pedro

Gysbert_Wassenaar

I think sum({1<FieldX=p()>} total_payments) is a close as you can get.


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

I remember some method to dynamically get all fields to clear, like described here (at the bottom of the post):

http://community.qlik.com/docs/DOC-1334

johnw
Champion III
Champion III

swuehl wrote:

I remember some method to dynamically get all fields to clear, like described here (at the bottom of the post):

http://community.qlik.com/docs/DOC-1334

That's how I do it.  It can be difficult getting the syntax right unless you know exactly what you're doing and why (or cut and paste from an example), but it does the trick while still being a fairly compact expression.

Not applicable
Author

Hey there,

this one was just perfect for my purpose.

Thanks everyone and have a nice day.

Juan Pedro

Not applicable
Author

Hey there im usign the method described at the bottom of that post (very usefull btw).

sum({$<[$(=Concat({1<$Field-={'PROJECT'}>}distinct $Field,']=,[')&']=')>} PAYMENT_AMOUNT)

as long as this is the expression everything is working fine. The only problem is that i need to do an aggregation on the sum since i have invoices that has been paid in a rateal way or similar.

sum(AGGR({$<[$(=Concat({1<$Field-={'PROJECT'}>}distinct $Field,']=,[')&']=')>} PAYMENT_AMOUNT, INVOICE_PAYMENT_ID))

Now when i add the aggregation function the chart is not working properly anymore since is considering the low level selections aswell.

Any ideas?

Regards,

Juan Pedro

Gysbert_Wassenaar

Try the aggr on the outside of the sum


talk is cheap, supply exceeds demand
Not applicable
Author

Already did it. Not working properly the returned amount is not the right one 😕