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

Calculating YTD from Monthly data where month is sorted from July to June

Hello,

I want to convert the attached pivot (monthly) data to show in YTD format.  Program months  column is sorted from July to June and is filtered to show only one financial year in the graph. Any help will be appreciated.

 

Expression for sorting the data: - match([Program Month],'Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May','Jun')

Expression for getting the monthly Actuals: - Sum([Actual Volume])

I am using below expression to calculate the YTD in the graph and is giving me the expected result. Unfortunately the same is not working for pivot.

RangeSum(Above(Sum([Actual Volume]), 0, RowNo()))

 

Thanks

Labels (2)
1 Solution

Accepted Solutions
Abhi_WP
Contributor III
Contributor III
Author

A colleague suggested to use ColumnNo() instead of RowNo() and it worked.

RangeSum(before(Sum([Actual Volume]), 0, ColumnNo()))

Thanks

View solution in original post

6 Replies
Channa
Specialist III
Specialist III

RangeSum(Before(Sum([Actual Volume]), 0, RowNo()))

 

try

 

Channa
Abhi_WP
Contributor III
Contributor III
Author

Thanks.

 

Still returning 0 for all the months.

YTD Actuals.jpg

 

 

Channa
Specialist III
Specialist III

sum(aggr(RangeSum(above(Sum([Actual Volume]), 0, RowNo())),Programmonth,values))

Channa
Abhi_WP
Contributor III
Contributor III
Author

Appreciate your help.

Logically, the formula you have provided should work but somehow I am still getting 0s.

sum(aggr(RangeSum(above(Sum([Actual Volume]), 0, RowNo())),[Program Month],
'Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar','Apr','May','Jun'))

 

Regards,

Abhi

Abhi_WP
Contributor III
Contributor III
Author

A colleague suggested to use ColumnNo() instead of RowNo() and it worked.

RangeSum(before(Sum([Actual Volume]), 0, ColumnNo()))

Thanks

Channa
Specialist III
Specialist III

Try give me sample data i will try or share qvf
Channa