Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analisys

Dear all,

I have this calculated dimension: 

aggr(sum(PURCHASEVALUE), SUPPLIER, PURCHASE_month)

and it works, but I would sum PurchaseValue just till September

Is it possible to insert a condition, like PURCHASE_month <= 9 ?

How can I solve this problem ?

Help!! please

Thanks in advance

1 Solution

Accepted Solutions
perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

use this expression 

aggr(sum({<PURCHASE_month={' <= 9'}>}PURCHASEVALUE), SUPPLIER, PURCHASE_month)

View solution in original post

6 Replies
perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

use this expression 

aggr(sum({<PURCHASE_month={' <= 9'}>}PURCHASEVALUE), SUPPLIER, PURCHASE_month)

Anonymous
Not applicable
Author

Hi Perumal,

it works, I just changed  the '  with the "

One thing more: instead of 9 as month, may I insert a field name ? I tried it but it doesn't work.

like:

aggr(sum ........month={" <= MY_FIELD "} ..........)

Help again please.

Thanks

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

I have one doubt ,MY_FIELD filed contains only one data or multiple data

Try this expression

aggr(sum({<PURCHASE_month={' <= $(=max(MY_FIELD))'}>}PURCHASEVALUE), SUPPLIER, PURCHASE_month)

Anonymous
Not applicable
Author

Hi,

It doesn't work. But perhaps it's better I give you something more.

My user has the possibility to choose Year and Month. I've to calculate for each supplier

the total purchases amount based on the year and month. If I choose August, I have to calculate the sum of all the values till August; the same if I choose June or another month.

By aggr function I always calculated the total and It's wrong.

Aggr, I think is the right way, but I don't know how to insert the condition by a field

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

It is possible upload sample application for reference

Anonymous
Not applicable
Author

Hi Perumal,

following your previous answer and trying and trying, I solved.

TRy this:

=aggr(sum({<PURCHASE_MONTH={ "<= $(=only(MY_MONTH))"}>} PURCHASEVALUE),SUPPLIER, PURCHASE_MONTH).

I'm going to do other checks now, just to be sure, but it seems correct ( I strongly hope)

I'll keep you informed