Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to make a bar chart to show the sales . First I'm trying to show the sales in the year, the dimension are the month ( from jan. to dec.). Now I'm trying to show the sales from jun. of the previous year (2014) to jun of the actually year (2015)
How can I do this?
thank very much!!
at script create a numeric field, say MonthNumber like this:
YearField*12+month(DateField) as MonthNumber
then take Month as a Dim
and expression would be: sum({<MonthNumber={'>=$(=max(MonthNumber)-12)<=$(=max(MonthNumber)'} >} Sales)
I use the expresion
=sum({<fecha={">=$(=date(addmonths(monthstart(today()),-18),'DD/MM/YYYY'))<=date(monthstart(today()),'DD/MM/YYYY')"}>}Ventas)
And the chart show the data between june of 2014 to december of 2015 this is ok. The problem is that I'm create in the script a new two fields using fecha field (DD/MM/YYYY), year(fecha) and month(fecha) .
I need that when I select year 2015 for example, the chart show me dates between june of 2014 and december of 2015.
and for another example, when I select year 2014 the chart show me dates between june of 2013 and december of 2014.
Now when I select year 2015 the chart show me only data of 2015 and not from june of 2014 to december of 2015.
Can you help me?
thanks!
If you have AS of data in your system then you can extend solution suggested by balrajahlawat by storing month number in variable. Variables will contain latest month number and it will get updated on selection will indeed will give you moving 12 months in chart.
Hi Juan,
Please create a variable storing a latest year month value and use that variable inside your set analysis condition to provide range.
For example VCurrentMonth stores your month than give range between VCurrentmonth & VCurrentmonth -12.
Please be mindful that variable should get updated on selection of month year dimension.