2 Replies Latest reply: Feb 27, 2011 2:08 PM by Steve Dark

# comparing two dates

Good afternoon,

Is to improve the attached file?

Thanks,

Gledson

• ###### comparing two dates

Using Set Analysis would be good to try. Instead of:

if(AnoInicio5ano = 2009, Sum([Qtd Aluno]))

try

sum( {\$<AnoInicio5ano = {2009}>} [Qtd Aluno])

If you wanted you could also try something like:

sum( {\$1} [Qtd Aluno])

and

sum([Qtd Aluno])

Using the second would give you some flexibility.

"sum([Qtd Aluno])" gives you the sum of your current selection.

"sum( {\$1} [Qtd Aluno])" gives you the sum of your previous selection.

So, if you had more than two years, say 2007, 2008, 2009 and 2010 you could select which years you wanted to compare without having a anymore than two columns in your chart.

• ###### comparing two dates

Hi Gledson,

Set analysis is generally better, but if syntax can be simpler to read. It would appear you have the order of the if and the sum wrong in the expression:

if(AnoInicio5ano = 2009, Sum([Qtd Aluno]))

Should read:

Sum(if(AnoInicio5ano = 2009, [Qtd Aluno], 0))

Hope that helps,
Steve