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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis and aggr function

Hi everyone,

I have 2 set analysis and I would like to have a pivot like this:

CHIAVE LOCAZIONE   2013/01   2012/12    2012/11 ....

loc1                10        5            13

loc2                45        7             8

Quantity is obtained by a fraction of 2 set analysis

SET 1:

=(sum({$<[CHIAVE LOCAZIONE]={'8§OUTCHIMICO','8§OUTABRASIV', '8§SMALTIMENT'}>}(QUANTITA*COSTO)))

and I would like to aggr this for year and month

SET 2

the other one is

=(sum({$<[COD SOCIETA]={'8'}>} total(QUANTITA*COSTO)))

in this one total is NOT correct because i would like to have quantità*costo aggr by year and month

So, month per month i would see quantità*costo of this set of LOCAZIONE

[CHIAVE LOCAZIONE]={'8§OUTCHIMICO','8§OUTABRASIV', '8§SMALTIMENT'}

in fraction with

quantità*costo of ALL CHIAVE LOCAZIONE

I'm not able to write the 2 correct set analysis. Can You help me please?

Thankyou

Labels (1)
2 Replies
Not applicable
Author

=(sum({$<[CHIAVE LOCAZIONE]={'8§OUTCHIMICO','8§OUTABRASIV', '8§SMALTIMENT'}>}aggr(sum(QUANTITA*COSTO),YEAR_MONTH))


=(sum({$<[COD SOCIETA]={'8'}>} aggr(sum(QUANTITA*COSTO),YEAR_MONTH))


Anonymous
Not applicable
Author

Thankyou but this is not i really want. I need group by for year and month for both expressions

expression 1

=(sum({$<[CHIAVE LOCAZIONE]={'8§OUTCHIMICO','8§OUTABRASIV', '8§SMALTIMENT'}>}aggr((QUANTITA*COSTO),YEAR_MONTH))


in this way doesn't work...

And the second one

=(sum({$<[COD SOCIETA]={'8'}>} aggr((QUANTITA*COSTO),YEAR_MONTH))

in this way doesn't work...