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: 
RutiTaumanRubin
Creator
Creator

Aggr function with if - Qlik Sense

Hi everyone,

I try to perform the following expression (aggr function in if conditional) but it doesn't work:

if(GetFieldSelections([Select Type])='Region',Region,

aggr(if(isnull(NAME),'Other',NAME),NAME))

Could you please advise?

Thanks,

Ruti.

6 Replies
devarasu07
Master II
Master II

Hi,

u can't use aggregation in your case. only when you having functions like  Max, sum, count , avg etc. then the aggregation function will work.

may u can try like this,

if(GetFieldSelections([Select Type])='Region',Region,

if(isnull(NAME) or len(trim(NAME))<=0,'Other',NAME))

also check this article about the aggregation function in qlik

https://www.analyticsvidhya.com/blog/2014/02/aggr/

Aggregate function

Thanks,
Deva

RutiTaumanRubin
Creator
Creator
Author

Thank you for your response ..

I need the aggr function...

justinphamvn
Creator II
Creator II

Hi Ruti,

Could you share your samples data and purpose for if condition ?

Regards,

Justin.

sunny_talwar
MVP
MVP

Why do you need it? Can you elaborate on this please?

dionverbeke
Partner - Creator III
Partner - Creator III

I think you should fix this in the script rather than using aggr.

I would suggest to add an if in your script.

Kr,

Dion

Ricardo_Gerhard
Employee
Employee

Dear Ruti,

I guess that you could mark this itens on load script, then create a aggr function.

Like this on load:

if([Select Type]='Region',Region,'Other') as NAME

Ricardo Gerhard
OEM Solution Architect
LATAM