Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

RutiTaumanRubin
Contributor

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

Re: Aggr function with if - Qlik Sense

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
Contributor

Re: Aggr function with if - Qlik Sense

Thank you for your response ..

I need the aggr function...

justinphamvn
Contributor II

Re: Aggr function with if - Qlik Sense

Hi Ruti,

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

Regards,

Justin.

Re: Aggr function with if - Qlik Sense

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

Luminary
Luminary

Re: Aggr function with if - Qlik Sense

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

Employee
Employee

Re: Aggr function with if - Qlik Sense

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