Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to aggregate values on a monthly basis.
I have the following data points:
Date | Revenue |
4/9/2012 | 50,000 |
4/9/2012 | 140,000 |
5/8/2012 | 40,000 |
5/31/2012 | 50,000 |
6/5/2012 | 50,000 |
I would like to instead present the data as
Date | Revenue |
April 2012 | 190,000 |
May 2012 | 90,000 |
June 2012 | 50,000 |
I am not able to follow the example presented here:
Aggregate data on monthly basis
http://www.qlikcommunity.com/message/292323#292323
If possible could someone provide a more straightforward way of doing this?
Create a chart:
- create a dynamic dimension using =date(MonthStart(Date) , 'MMM YYYY')
- create an expression =sum(Revenue)
Done.
Create a chart:
- create a dynamic dimension using =date(MonthStart(Date) , 'MMM YYYY')
- create an expression =sum(Revenue)
Done.
Test:
Load * INLINE [
Date,Revenue
4/9/2012,50000
4/9/2012,140000
5/8/2012,40000
5/31/2012,50000
6/5/2012,50000
];
Load
MonthName(Date) as Month_Year,
Revenue
Resident Test;
Drop Table Test;
Test1:
Load
Month(Date)&Year(Date) as MonthYear,
Revenue
resident test;
Load
MonthYear,
Revenue
group by MonthYear
resident Test1;
Hope this helps
Load
MonthYear,
sum(Revenue) as Revenue,
group by MonthYear
resident Test1;
Forgot to sum it by MonthYear previously.