2 Replies Latest reply: Dec 16, 2011 2:02 PM by javierortiz

# Set Analysis expresion into another Set Analysis Expresion

Hi everybody, I have my sales defined like this:
SALES Expresion:
sum  ({\$<INFOTYPE={'REAL'}>}[SALES MXN]/TC)/1000+sum({\$<INFOTYPE={'UM6'}>}[SALES MXN]/TC)/1000
and I want to use my sales to get last year sales:
LAST YEAR Expresion
sum ({\$<Year = {\$(=only(Year) - 1) }, Month = {"<=\$(=max(Month))"}>} Sales)
is just replacing my SALES Expresion into LAST Year Expresion?
is there any way to get this working?
• ###### Set Analysis expresion into another Set Analysis Expresion

Your first expression should be equivalent to

=sum  ({\$<INFOTYPE={'REAL','UM6'}>}[SALES MXN]/TC) / 1000

i.e. you can set multiple values within a set element. Does this result in correct values?

Then I would assume last years sales should be

=sum  ({\$<INFOTYPE={'REAL','UM6'}, Year= {\$(=only(Year)-1)}, Month={"<=\$(=max(Month))"} >}[SALES MXN]/TC) / 1000

Hope this helps,

Stefan

• ###### Set Analysis expresion into another Set Analysis Expresion

Wow!! it works perfectly,  excelent once again you helped me a lot.

Thank you very much Swuehl!!!