7 Replies Latest reply: Apr 13, 2012 1:46 PM by Kaushik Solanki

# Day Month Dimension

I would like to have both years show up on the same line/bar graph.

Date(Date,'MM/DD') - Right now I get two entries for 01/01, with 2 years of data. That makes sense, but I want to compare the two years, and I would like them be combined.

Any ideas?

Thanks,

Alex

• ###### Re: Day Month Dimension

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

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

Hi,

I think this variables should be created in

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

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

Hi,

Create a new field

MonthName(Date) as MonthYear

Then use this set expression.

Regards,

Kaushik Solanki

• ###### Day Month Dimension

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

Hi Oleg,

The issue is that they want to see the data down to the date. Like my example.