Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
bibopipo
Contributor II

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
Valued Contributor II

Re: set analisys

Hi

use this expression 

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

6 Replies
perumal_41
Valued Contributor II

Re: set analisys

Hi

use this expression 

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

bibopipo
Contributor II

Re: set analisys

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
Valued Contributor II

Re: set analisys

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)

bibopipo
Contributor II

Re: set analisys

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
Valued Contributor II

Re: set analisys

Hi,

It is possible upload sample application for reference

bibopipo
Contributor II

Re: set analisys

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

Community Browser