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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
RheaQv12
Creator
Creator

get the max value after aggr....

Hi,

i have a table in which i have the transaction date like PostedDate - i derived the last 7 days flag in the load script..

in a straight table i am trying to calculate the last 7 days using the flag and the following expression..

i need to pick the max value for the combination of PostedDate and the name

=if(PDate_7_Days=1 ,aggr(Max(aggr(sum(SumCounter),[PDate],[Name])),Name,[PDate]) ,0)

Capture.PNG

 

in my straight table i have other columns along with Name, PDate but i need to aggr by Name, PDate and get the sum(SumCounter) for the last 7 days (this is a flag) - from the above if i want to get the max value of (highlighted in yellow)

can someone please help... for each PDate and each Name of the file i need to pick the MAX value so that i get the last 7 days numbers

any help..

Capture1.PNG

 

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

May be try this

Sum({<Published_Last_7_Days = {"1"}, [Published Date], [Published End Date], [Published Start Date]>} Aggr(
  Sum({<[Published Date], [Published End Date],[Published Start Date]>} ReadCounter)
, Title, [Published Date]))

View solution in original post

6 Replies
Anil_Babu_Samineni

Perhaps this?

Max({<PDate_7_Days={1}>} TOTAL <PDate> aggr(sum({<PDate_7_Days={1}>} SumCounter),[PDate],[Name]))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
RheaQv12
Creator
Creator
Author

Thank you Anil, i got the expression fixed to working...but i have a scenario where the layout has dates like start date and end date - when these dates using calendar object are selected the above table should not get filter applied

i have the objects as below....when the start date, end date are selected they are still applying on the above table

 

 

i have this expression in the table on the top but still the ignore is not getting applied

Sum({<Published_Last_7_Days = {"1"}, [Published Date]=, [Published End Date]=,[Published Start Date]=>} Aggr(Sum(ReadCounter), Title, [Published Date]))

the fields in pink are ignoring but for some reason it is not working...

 

sunny_talwar

May be try this

Sum({<Published_Last_7_Days = {"1"}, [Published Date], [Published End Date], [Published Start Date]>} Aggr(
  Sum({<[Published Date], [Published End Date],[Published Start Date]>} ReadCounter)
, Title, [Published Date]))
RheaQv12
Creator
Creator
Author

thank you, what is the difference i thought in set analysis to ignore exclude we do like

 [Published Date]=

 [Published Date], 

thanks again

sunny_talwar

They mean the same thing within set analysis. = sign doesn't make a difference when you are trying to ignore selections

RheaQv12
Creator
Creator
Author

thank you Sunny_Talwar;