-
Re: Day Month Dimension
Carlos Lisboa Mar 9, 2012 2:43 PM (in response to Alex Peasley )Hi Alex,
You could do it in multiple ways, i'll give you one which i believe is best.
create two variables:
vYearCurrent
=max(Year)
vYearPrevious
=(
if(
GetPossibleCount(Year)=2,
min(Year),
max(Year-1)
)
)
and now you can use these variables in the set analysis with two expressions, one for each year. Something like:
Current Year
sum({< Year= {"$(=vYearCurrent)"}>} Value)
Previous Year
Current Year
sum({< Year= {"$(=vYearPrevious)"}>} Value)
The vYearPrevious is done that way so that when the user want to analyse non-contigous years the graph will remain usefull. If you want it simpler, this variable can be just =max(Year-1).
Hope it helps
Regards,
Carlos
-
Re: Day Month Dimension
Alex Peasley Mar 9, 2012 4:28 PM (in response to Carlos Lisboa )The vYearPrevious variable did not work for me when I used LET. When I used SET, it didn't error but it does not work in my calculation.
-
Day Month Dimension
jagan mohan rao appala Mar 10, 2012 12:39 AM (in response to Alex Peasley )Hi,
I think this variables should be created in
Settings Menu -> Variable Overview -> Add
This should not be created in script.
You can also do this without using variables
Current Year
sum({< Year= {'$(=Max(Year))'}>} Value)
Previous Year
sum({< Year= {'$(=Max(Year) - 1)'}>} Value)
Regards,
Jagan.
-
Day Month Dimension
Alex Peasley Mar 11, 2012 8:02 PM (in response to jagan mohan rao appala )And Jagan. I can't exactly do it like that because my client wants to see rolling 12 months in the graph.
-
Day Month Dimension
Kaushik Solanki Apr 13, 2012 1:46 PM (in response to Alex Peasley )Hi,
Create a new field
MonthName(Date) as MonthYear
Then use this set expression.
Sum({<MonthYear = {">=$(=MonthName(addmonths(max(Date),-12)))"}>}FieldName)
Regards,
Kaushik Solanki
-
-
-
-
-
Day Month Dimension
Oleg Troyansky Mar 10, 2012 11:33 AM (in response to Alex Peasley )I think the solution is very simple:
Line chart with 2 dimensions: Year and Month.
Months will supply the 12 values for the X-axes, and Year will cause multiple line series toe be created.
If you have more than 2 Years of data, and you need to limit the scope for the chart, you can also add a Set Analysis condition in your expression to only count last 2 years.
cheers,
Oleg
-
Re: Day Month Dimension
Alex Peasley Mar 11, 2012 4:08 PM (in response to Oleg Troyansky )Hi Oleg,
The issue is that they want to see the data down to the date. Like my example.
-
Re: Day Month Dimension
Глеб Аитов Jan 31, 2017 3:11 AM (in response to Oleg Troyansky )OMG
I have spent the whole day playing with set analysis to display various periods on the same X chart, until i saw you very simple solution. Thank you!
-