Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
su88rao
Partner - Contributor III
Partner - Contributor III

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

Labels (4)
3 Replies
JordyWegman
Partner - Master
Partner - Master

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

Hi  Everyone,

My requirement I have Duration column like Below.

duration second's

00:00:28

00:00:28

00:00:28

00:00:29

00:00:29

00:00:29

 

When I Trying to sum i am getting 00:00:57

Can any one help me sum the above seconds

JordyWegman
Partner - Master
Partner - Master

Hi,

Could you maybe share the raw data? Then we can check this!

Jordy

Climber

Work smarter, not harder