Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Historical comparison in line chart

Hello,

Suppose I've got a table of EventIDs each with a corresponding StartDateTime. I'd like to have a line graph with the horizontal dimension as the week of the year (e.g. 12/3/2012, 12/10/2012 etc.) and one expression as the count of EventIDs during a given week with another expression as the average of the three weeks prior to the given week.

I've loaded the data 3 additional times, each time with an additional +1 week offset. This can't be the way to go. Any suggestions? Thank you! -Reid

I'm aggregating the event dates by week during a LOAD statement with

Dual(WeekStart(StartDateTime), Year(StartDateTime)*100+Week(StartDateTime)) as StartWeekYear,

and I'm giving the offset to the additional tables with

Dual(WeekStart(StartDateTime + 7), Year(StartDateTime + 7)*100+Week(StartDateTime + 7)) as StartWeekYear,

1 Reply
Not applicable
Author

Accumulation would let me get a moving average, but I'd like to be able to use the average value within another expression.