Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

aminehaddar
New 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
sureshqv
Esteemed Contributor III

Re: Aggregation if elsif statement

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)

3 Replies
sureshqv
Esteemed Contributor III

Re: Aggregation if elsif statement

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

Re: Aggregation if elsif statement

Thanks for your quick answer,

sureshqv
Esteemed Contributor III

Re: Aggregation if elsif statement

nice have a nice day

Community Browser