Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculated Dimension field error

Hi all,

I am trying to determine a dimension field based on a calculation.

The value 1 gives the count when the FLAG dimension is COMP

The value 2 gives the count when  the FLAG dimension is NO COMP.

The value 3 gives the total number of COUNT for the selected period

When the value 2 is more than 10%, then the dimension should be simply be  NO_COMP  and ignore COMP.

I tried to calculate a dimension field based on this, it gives me an error.

Please any one can hint me the error  or say me the way to achieve it.

Thanks in advance

Jegadish

Hi Sunny,

I have added an example as requested

Jegadish

5 Replies
sunny_talwar

You will need to wrap your expression around with the Aggr() function and use the dimension you are doing the two counts against

Anonymous
Not applicable
Author

Hi sunny, thanks for your suggestion,

I tried this sentence,  it gives me an error.

FLAG IS THE DIMENSION, it contains two values 'COMP & NON COMP')

IF THE COUNT OF NON_COMP is superior to 10% then the DIMENSION FLAG should be considered as NON COMP otherwise it gets the value of the DIMENSION)

=If(Aggr(FLAG, count(distinct {<FLAG = {'NO COMP'}>})/count(distinct {<FLAG = {'NO COMP','COMP'}>}) > 10, 'NO COMP', FLAG))

Thanks in advance for your kind help

sunny_talwar

Would you be able to share a sample?

sunny_talwar

I guess we have managed to resolve this outside of Qlik Community, would you be able to close this thread by providing a jist of what was needed and closing this thread by marking either your own response as correct or marking assumed answer.

Best,

Sunny

Anonymous
Not applicable
Author

=Aggr(If(Count(DISTINCT {<FLAG = {'NO COMP'}>}FLAG)/Count(DISTINCT {<FLAG = {'NO COMP','COMP'}>}FLAG) > 0.10, 'NO COMP', FLAG), DEPADR_PAYS_LIB, MAG_LIBELLE)