Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

second if condition in expression not working in qliksense

Hi,

I am trying to get the sum of a column based on calculated dimension, i want to restrict the value to top 5 based on category.

i m not able to restrict it. the output is displaying all the values. also and and/or function inside expression is not working out. 

can anybody help me out here and suggest where i am going wrong.

below is the expression i am trying to in corporate

 

IF(Aggr(Rank(-SUM({<DateID={"<=$(=Max(DateID))>=$(=Max(DateID)-3)"},Date=>}abc),4),categ,id)<=5,
sum({<DateID={$(=max(DateID)-0)},Date=>}cal),


IF(aggr(SUM({<DateID={"<=$(=Max(DateID))>=$(=Max(DateID)-3)"},Date=>}abc), abc)=0 or
Aggr(Rank(SUM({<DateID={$(=max(DateID)-0)},Date=>}cal),4),categ,id)<=5,
sum({<DateID={$(=max(DateID)-0)},Date=>}cal)))

 

Thanks & Regards

Suraj Rao

1 Reply
Partner
Partner

Re: second if condition in expression not working in qliksense

Hi Suraj,

Because you use aggregation functions, you need to apply the set analysis to all the aggregation functions.

So what is needed is the addition in the aggr(). Do this also for the other statements.

IF(
Aggr(
  {<DateID={"<=$(=Max(DateID))>=$(=Max(DateID)-3)"},Date=>}abc),4),categ,id)<=5,
  sum({<DateID={$(=max(DateID)-0)},Date=>}

Rank(-SUM({<DateID={" <=$(=Max(DateID))>=$(=Max(DateID)-3)"},Date=>}abc),4),categ,id)<=5,
sum({<DateID={$(=max(DateID)-0)},Date=>}cal),

 Jordy

Climber

Work smarter, not harder