Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

IF in UI Level

Hi All,

I need a small clarification on IF statement...

If we want to retrieve the value from matching fields suppose,

IF(AGE_GRP = AGE_18GROUP, POPULATION) -- won't work

POPULATION have only one value for one age group....

but if i write

sum(IF(AGE_GRP = AGE_18GROUP, POPULATION)) -- will work...

Why it need an aggregation?

1 Solution

Accepted Solutions
sundarakumar
Specialist II
Specialist II

Hi Jansi,

U require an aggregation there since the field values AGE_GRP and AGE_18Group returns more than one value when nothing is selected. It is working good in what Chirannjeevi has posted since he has selected only one value.

if AGE_GRP and AGE_18Group  are relate one to one then u can use

IF(getfieldselections(AGE_GRP )= getfieldselections(AGE_18GROUP), POPULATION)

This will work if u select one entry.

Pls post sample data and specify the req so that we can help u on it.


-sundar

View solution in original post

3 Replies
chiru_thota
Specialist
Specialist

Which object you are trying this expression actually?

Because I tried in text object & Chart.It is working fine with out SumIf text.jpg

Not applicable
Author

Just unselect the 'America' and show the result... It is not working..

sundarakumar
Specialist II
Specialist II

Hi Jansi,

U require an aggregation there since the field values AGE_GRP and AGE_18Group returns more than one value when nothing is selected. It is working good in what Chirannjeevi has posted since he has selected only one value.

if AGE_GRP and AGE_18Group  are relate one to one then u can use

IF(getfieldselections(AGE_GRP )= getfieldselections(AGE_18GROUP), POPULATION)

This will work if u select one entry.

Pls post sample data and specify the req so that we can help u on it.


-sundar