Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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!