Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

editing aggr expression

Hi Everyone

Can someone help me how can i modify below expression

with this condition: if HOURS is >6 but <12

Sum({<WEEK = {"$(=MaxString(WEEK))"}>}Aggr(If(Count({<WEEK = {"$(=MaxString(WEEK))"}>}DEVICE)=1,1,0) and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS)<=6, DEVICE))*-1

Thanks and hope to hear from you.....

1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum({<WEEK = {"$(=MaxString(WEEK))"}>} Aggr(

If(Count({<WEEK = {"$(=MaxString(WEEK))"}>}DEVICE) = 1 and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS) > 6 and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS) < 12,1,0), DEVICE))*-1

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Sum({<WEEK = {"$(=MaxString(WEEK))"}>}Aggr(If(Count({<WEEK = {"$(=MaxString(WEEK))"}>}DEVICE)=1,1,0) and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS)<=12 and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS)>6, DEVICE))*-1

sunny_talwar

May be this

Sum({<WEEK = {"$(=MaxString(WEEK))"}>} Aggr(

If(Count({<WEEK = {"$(=MaxString(WEEK))"}>}DEVICE) = 1 and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS) > 6 and Only({<WEEK = {"$(=MaxString(WEEK))"}>}HOURS) < 12,1,0), DEVICE))*-1

Anonymous
Not applicable
Author

Hi Sunny & Robin,

Both your formula works well..

thanks and have a good day!