Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rendiyan
Partner - Creator
Partner - Creator

[ASK] how to sum last 50 days grouped by dayname

Dear QlikView master,

my client have a requirement to sum value for the last 50days and grouped by dayname.

For example mw last 56days data will be like below :

Untitled.png

with expressions :

sum({<Year=, Quarter=, Month=, Week=, CalDate=

{'>=$(=date(daystart(vEndDate, -$(vDayParam)*7)))'}*{'<=$(=date(daystart(vEndDate)))'}>}

Quantity)

And User expectation will be like :

Untitled.png

Is that achieveable with qlikview?

if yes, how to achieve that expectation?

Thank You,

Best Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable

Not sure why you would need the aggr.

I think just this would work.

sum({<Date={">=$(=Date(Today()-56,'MM/DD/YYYY'))"}>}Value)

View solution in original post

4 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Rendi,

Use the following expression,

sum({<Date={">=$(=Date(Today()-50,'MM/DD/YYYY'))"}>}aggr(sum({<Date={">=$(=Date(Today()-50,'MM/DD/YYYY'))"}>}Value),NameDay))

And make a chart with only the NameDay and expression. I've hardcoded the 50 value, so it gets the last 50 days as of today, but you can change the logic behind it

Attached a sample data and qvw file.

Felipe.

Anonymous
Not applicable

Not sure why you would need the aggr.

I think just this would work.

sum({<Date={">=$(=Date(Today()-56,'MM/DD/YYYY'))"}>}Value)

felipedl
Partner - Specialist III
Partner - Specialist III

Yeah, you're right Wallo, it's not really needed.

He can simply put it the way you stated.

rendiyan
Partner - Creator
Partner - Creator
Author

yes thank's..