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: 
Not applicable

Rolling 60 for each month

Hi Eveyone,

  I'm looking to get a rolling 60 day sum for each month. Not just the last 60 days. See example. How would I implement this?

I currently have a line graph with the last 60 days in the expression. I want to the last 60 days for each month. Does that make sense?

Alex

Labels (1)
1 Solution

Accepted Solutions
johnw
Champion III
Champion III

This may be similar to what you're asking for.  The three charts show three different options.  In this case, they show a rolling three months, but it's hopefully fairly clear (with some study, I'm sure) what to do to convert any of them to rolling 60 days.

View solution in original post

13 Replies
Not applicable
Author

anyone?

johnw
Champion III
Champion III

This may be similar to what you're asking for.  The three charts show three different options.  In this case, they show a rolling three months, but it's hopefully fairly clear (with some study, I'm sure) what to do to convert any of them to rolling 60 days.

Not applicable
Author

Awesome John. I used the last of the three charts in my application and it worked great. It should be ease to replicate for 60 days. 90 days was actually a requirement also. I really appreciate it!

Alex

Not applicable
Author

Hey John, I more thing. I'm trying to add another dimension to the graph, but it only shows the 1 typ of my dimension at a time. But if I select the dimension in a list box it renders correctly, but not all of them are shown on the graph. Any ideas what I need to change?

johnw
Champion III
Champion III

You can only have two dimensions, I believe - your X axis dimension, and the dimension that controls how many lines are being displayed.  If you MUST have a line for each combination of year and some other dimension, you could concatenate the two together as a calculated dimension.  I think for most data sets that would simply produce a mess, though.

Perhaps you should be using a year+month as the X axis, and use your other dimension for the lines in the chart.

I'm not entirely sure I've understood what you're trying to show, though, or what your data looks like.

Not applicable
Author

I only have two dimensions. AsOfMonth, and Region. I don't understand why its not showing a line for Region. I attempted to use YearMonth as the X Dimension, but it still did not work. It just doesn't make sense to me, because I can select each Region and they render as single line on the graph.

johnw
Champion III
Champion III

Works fine for me and nothing is jumping out at me as a possible explanation.  Maybe if you have an expression with an aggr() somewhere, you could have forgotten to add Region to it, but that's grasping at straws.  I don't know your data model or chart expressions, so I can't actually debug.

Not applicable
Author

Not grasping at straws at all. That was the key. So if I have an with an aggregation, I have to add the dimension in the expression? I'm not very well-versed with the aggregation functions. Thanks again John.

johnw
Champion III
Champion III

Let's say we start with a chart that looks something like this:

Dimension  = Month Year
Expression = avg(aggr(sum(Sales),Customer))

So for each month, we want to know the average of customer sales.  Now you decide you want to know the average of customer sales by Region.  If you just add the Region dimension with no further changes...

Dimension 1 = Month Year
Dimension 2 = Region
Expression  = avg(aggr(sum(Sales),Customer))

...it probably won't work right, because the aggr() is, I believe, explicitly telling QlikView to ignore the Region field.  So I'd expect all of the lines to overlap, and only the top line would show.  I think you would need this instead:

Dimension 1 = Month Year
Dimension 2 = Region
Expression  = avg(aggr(sum(Sales),Region,Customer))

I'm not entirely certain, though.