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: 
ishanbansal1204
Contributor III
Contributor III

Weekly and YTD Value in combo chart

Hi Experts,

I have a combo chart where the dimensions are week and then the first measure that i am using is the sum(count) at  a week level

but i am not getting the YTD value

e.g.

for weeek 1 value will be 10 and YTD will be10

for week 2 value will be 20 and YTD will be 30

THis should be grouped at week and year level.

I have attached the sample file.

26 Replies
ishanbansal1204
Contributor III
Contributor III
Author

Thanks for the file.

But in the file that you had shared

apply filter on date and select last few weekyear filter

in that case YTD values are calculated based on the filter selected but that should not be the case.

Please find the updated file and let me know.

Thanks.

The attachment is in the main tread.

ishanbansal1204
Contributor III
Contributor III
Author

Hi Eromiya Simon,

This will work fine if no filters are applied. if i apply filter on week and select few weeks then YTD values are calculated only for the selected week but YTD has to be calculated irrespective of the week selected.

eromiyasimon
Creator II
Creator II

you can use this expression


Sum(Aggr(rangesum(Above(Total sum({<WEEK>} COUNT),0,RowNo(Total))),WEEK))


or

you can simply detach the chart or you can setup alternative state to preserve the values being changed while the selection has been made.

tresesco
MVP
MVP

In that case, try the expression below:

Sum(Aggr(rangesum(Above(Total sum({<WEEK>} COUNT),0,RowNo(Total))),WEEK))

antoniotiman
Master III
Master III

See Attachment

ishanbansal1204
Contributor III
Contributor III
Author

Not Working. Showing some incorrect values.

ishanbansal1204
Contributor III
Contributor III
Author

Not Working. Showing some incorrect values.

ishanbansal1204
Contributor III
Contributor III
Author

Hi Antonio,

The calculation was done in the load script as per your file that you shared.

Is there any possibility that i can use some calculation in the measure or in the dashboard itself rather than in the load script.?

eromiyasimon
Creator II
Creator II

hi ishan,

i donno why you are getting error,

use the attached QVW.

tresesco
MVP
MVP

Since your dimension is WeekYear, you have to change the expression accordingly like:

Sum(Aggr(rangesum(Above(Total sum({<WeekYear>} COUNT),0,RowNo(Total))),WeekYear))