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: 
aminehaddar
Contributor II
Contributor II

Aggregation if elsif statement

Hello,

I need to use a conditional statment to group in intervals.

So I used this function

Aggr(

If(X=0, '0',

If(X>0 and X<10000,  '0<CA<10K',

If(X>=10000 and X<200000,  '10k=<CA<20k',

If(X>=20000 and X<50000,   '20k=<CA<50k',

If(X>=50000 and X<70000,   '50k=<CA<70k',

If(X>=70000 and X<100000,  '70k=<CA<100k',

If(X>=100000 and X<150000, '100k=<CA<150k',

If(X>=150000 and X<200000, '150k=<CA<200k',

if(X>=200000, '200k=<CA '

))))))))))

I got an error in the expression.

I think it is a problem with the agregation.

Any help please?

Regards

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

aggr with dimension need

Aggr(

If(X=0, '0',

If(X>0 and X<10000,  '0<CA<10K',

If(X>=10000 and X<200000,  '10k=<CA<20k',

If(X>=20000 and X<50000,   '20k=<CA<50k',

If(X>=50000 and X<70000,   '50k=<CA<70k',

If(X>=70000 and X<100000,  '70k=<CA<100k',

If(X>=100000 and X<150000, '100k=<CA<150k',

If(X>=150000 and X<200000, '150k=<CA<200k',

if(X>=200000, '200k=<CA '

))))))))),Dim1,Dim2)

View solution in original post

3 Replies
Chanty4u
MVP
MVP

aggr with dimension need

Aggr(

If(X=0, '0',

If(X>0 and X<10000,  '0<CA<10K',

If(X>=10000 and X<200000,  '10k=<CA<20k',

If(X>=20000 and X<50000,   '20k=<CA<50k',

If(X>=50000 and X<70000,   '50k=<CA<70k',

If(X>=70000 and X<100000,  '70k=<CA<100k',

If(X>=100000 and X<150000, '100k=<CA<150k',

If(X>=150000 and X<200000, '150k=<CA<200k',

if(X>=200000, '200k=<CA '

))))))))),Dim1,Dim2)

aminehaddar
Contributor II
Contributor II
Author

Thanks for your quick answer,

Chanty4u
MVP
MVP

nice have a nice day