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

Use Alternate state in expression with aggr

Dear Community,

i have following expression:

SUM(aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT))

And the alternate state:

X

Now i want to transform this expression so it runs under the alternate state X

I tried :

sum({X} aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT))

But the aggreagate is not working over this alternate state

Please help!

13 Replies
avinashelite

no , you should mention the dimension in alternate state to act on this count , try like this

sum({X<D1 = $::D1,D2 = $::D2} aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT))

here the D1 and D2 are the dimension which are being used in the alternate state

ecolomer
Master II
Master II

try this

sum(aggr({X} Distinct (AMOUNT), SN,DATE, AMOUNT))

and in the alternate state dont select X

Anonymous
Not applicable
Author

Hi Enrique,

With such a syntax i am getting the same result as the initial expression

SUM(aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT)) so it does not use the alternate state

Anonymous
Not applicable
Author

Hi Avinash,

i mentioned now all dimensions :

sum({X<DATE = $::DATE,SN = $::SN,AMOUNT= $::AMOUNT} aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT))


but its still not working i am getting all the time the same result as the initial expression:

SUM(aggr(DISTINCT(AMOUNT),SN,DATE,AMOUNT))


When using simple:

sum({X}AMOUNT) its working but i need the aggregate!

sasiparupudi1
Master III
Master III

Hi

Please post your application here

Sasi

antoniotiman
Master III
Master III

sum(aggr(DISTINCT  Only({X} AMOUNT),SN,DATE,AMOUNT))

or Sum( instead Only(

avinashelite

hi BioB_Paul,

As per knowledge we cannot specify the aggr function to aggregate on the alternate state dimensions, by default it will on the default state, if you want to aggregate then your chart and the aggregating dimension need to be in same state...no other way yo get it work

Anonymous
Not applicable
Author

Still it does not work, and behaves like its not using the alternate state for the aggr.

Tried "only" or "sum" ...