Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have to show the Last 3 Months Sales data in a Line Graph. The functionality should be like this - If any Month is selected from the List Box, the graph should show - Sales for selected month and its previous 2 months.
Ex: If I select Dec-14, the graph would Sales for Dec-14, Nov-14 and Oct-14
When nothing is selected, it would show the Latest Month (Feb-15) and previous 2 months (Jan-15, Dec-14).
Could some please help with a demo. Here is the data:
| Month | Sales |
| Mar-14 | 100 |
| Apr-14 | 150 |
| May-14 | 120 |
| Jun-14 | 240 |
| Jul-14 | 80 |
| Aug-14 | 180 |
| Sep-14 | 110 |
| Oct-14 | 230 |
| Nov-14 | 330 |
| Dec-14 | 190 |
| Jan-15 | 250 |
| Feb-15 | 280 |
Any help here please?
Please find an example attached.
You should have a master calendar where you can have a consecutive number for your month so that you can easily calculate max(month_number)-1 , -2 ...and so on
!
is your month a string format ? or a date formatted to as 'MMM-YY' if it is a date format you could use the following expression
sum({<Month = {">=$(=(max(Month,3)))<=$(=(max(Month)))"}}Sales)
Hi,
Try like this
Script:
LOAD
*,
Date(Date#(Month, 'MMM-YY')) AS Date
FROM DataSource;
Now in chart try like this
Dimension: Month
Expression: Sum({<Month=, Date={'>=$(=MonthStart(Max(Date), -2))<=$(=Date(Max(Date)))'}>} Sales)
Hope this helps you.
Regards,
Jagan.