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

Split yearly total into a monthly total?

I have a data source like the following:

DateFY Total# of MonthsMonthly Total
7/1/2010$2,220,98412$185,081.97
8/1/2010$7,423,3771$7,423,377.38
9/1/2010$1,034,3242$517,161.99
10/1/2010$2,582,6603$860,886.67
11/1/2010$630,2914$157,572.71
12/1/2010$631,7385$126,347.53
1/1/2011$1,481,0036$246,833.86
1/11/2011$33,3516$5,558.58
2/1/2011$811,1587$115,879.66
3/1/2011$718,3918$89,798.88
3/31/2011$4,8288$603.52
4/1/2011$1,235,1309$137,236.65
5/1/2011$298,93610$29,893.57
6/1/2011$1,335,65411$121,423.06

I want to display it like this based on the number of months (divide the yearly total by number of months to get the monthly total and spread it across the months. 

DateJul 2010Aug 2010Sep 2010Oct 2010Nov 2010Dec 2010Jan 2011Feb 2011Mar 2011Apr 2011May 2011Jun 2011FY Total# of MonthsMonthly Total
7/1/2010$185,082$185,082$185,082$185,082$185,082$185,082$185,082$185,082$185,082$185,082$185,082$185,082$2,220,98412$185,082
8/1/2010$7,423,377----------$7,423,3771$7,423,377
9/1/2010$517,162$517,162----------$1,034,3242$517,162
10/1/2010$860,887$860,887$860,887---------$2,582,6603$860,887
11/1/2010$157,573$157,573$157,573$157,573--------$630,2914$157,573
12/1/2010$126,348$126,348$126,348$126,348$126,348-------$631,7385$126,348
1/1/2011$246,834$246,834$246,834$246,834$246,834$246,834------$1,481,0036$246,834
1/11/2011$5,559$5,559$5,559$5,559$5,559$5,559------$33,3516$5,559
2/1/2011$115,880$115,880$115,880$115,880$115,880$115,880$115,880-----$811,1587$115,880
3/1/2011$89,799$89,799$89,799$89,799$89,799$89,799$89,799$89,799----$718,3918$89,799
3/31/2011$604$604$604$604$604$604$604$604----$4,8288$604
4/1/2011$137,237$137,237$137,237$137,237$137,237$137,237$137,237$137,237$137,237---$1,235,1309$137,237
5/1/2011$29,894$29,894$29,894$29,894$29,894$29,894$29,894$29,894$29,894$29,894--$298,93610$29,894
6/1/2011$121,423$121,423$121,423$121,423$121,423$121,423$121,423
1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

See if attached is what you are looking for. It was a bit tricky, but this is the formula I used for expression:

if(if(max(total <Date>aggr($(eMonthlySavings)/CalcMonth, Date)) <> 0,mod(num(month(CalendarMonthAndYear))+5, 12)+1) <= max(total <Date> aggr(CalcMonth, Date)), max(total <Date>aggr($(eMonthlySavings)/CalcMonth, Date)))

This might not be the most optimized formula, but it works.

Hope this helps!

View solution in original post

1 Reply
jerem1234
Specialist II
Specialist II

See if attached is what you are looking for. It was a bit tricky, but this is the formula I used for expression:

if(if(max(total <Date>aggr($(eMonthlySavings)/CalcMonth, Date)) <> 0,mod(num(month(CalendarMonthAndYear))+5, 12)+1) <= max(total <Date> aggr(CalcMonth, Date)), max(total <Date>aggr($(eMonthlySavings)/CalcMonth, Date)))

This might not be the most optimized formula, but it works.

Hope this helps!