Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
skoppe
Contributor II
Contributor II

total previous quarters - offset in bar chart

Hi developers,

I have a question, example application attached.

question bar chart.PNG

I really hope that someone can help me and knows the solution. Thanks in advance!!!

Regards,

Stefan

1 Solution

Accepted Solutions
sunny_talwar

Is this what you want to get?

Capture.PNG

Expression

RangeSum(Above(Sum({<Year=, Quarter=, QuarterYear=, Month=, Week=, Date=, RolID={1}>}UserCounter), 0, RowNo())) * Avg({<Year=, Quarter=, Month=, QuarterYear=, Week=, Date={'>=$(=QuarterStart(Max(Date), -7))<=$(=Date(Max(Date)))'},RolID={1}>}1)

View solution in original post

8 Replies
sunny_talwar

Is this what you want to get?

Capture.PNG

Expression

RangeSum(Above(Sum({<Year=, Quarter=, QuarterYear=, Month=, Week=, Date=, RolID={1}>}UserCounter), 0, RowNo())) * Avg({<Year=, Quarter=, Month=, QuarterYear=, Week=, Date={'>=$(=QuarterStart(Max(Date), -7))<=$(=Date(Max(Date)))'},RolID={1}>}1)

skoppe
Contributor II
Contributor II
Author

Sunny T, you're the man! Thanks a lot!

regards,

Stefan

vinieme12
Champion III
Champion III

not sure  do you just need this?

=RangeSum(Above(Sum({<Year=, Quarter=, QuarterYear=, Month=, Week=, Date=, RolID={1}>}UserCounter), 0, RowNo()))

rangesum.PNG

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
skoppe
Contributor II
Contributor II
Author

Thanks Vineeth, that is part of the trick! Sunny T used that also.

What I wanted is Sunny T's solution. Thanks again!

regards Stefan

skoppe
Contributor II
Contributor II
Author

Hi Sunny,

I've reviewed your solution, trying to understand it.

Why do you use the second part?

* Avg({<Year=, Quarter=, Month=, QuarterYear=, Week=, Date={'>=$(=QuarterStart(Max(Date), -7))<=$(=Date(Max(Date)))'},RolID={1}>}1) always seems to give 1.

When I only use the first part of you expression it also works.

Am I missing something (important)?

Regards,

Stefan

skoppe
Contributor II
Contributor II
Author

Sorry now I get it, it's to keep the 8 rolling quarters. Nevermind.

Regards,

Stefan

sunny_talwar

If you remove the Avg(.... 1) part don't you see all the months?

Capture.PNG

The chart on the right doesn't use Avg(1) and you are seeing all the quarters and not just the 8 quarters? Do you wish to see all quarters?

sunny_talwar

Hahahaha yes, absolutely. Avg is only 1 for the 8 quarters and 0 otherwise.