Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ilanbaruch
Specialist
Specialist

Previous month expression

hi all,

in my model i have a straight table ,

i want to present dims and expression that will respond to user selection and one expression that will calculate previous month value based on current selection .

created a field in script as below :

AddMonths((MakeDate(xyear,xmonth,01)),-2) as the_prev_date,

and in the table expression :

=Sum({<the_date=p(the_prev_date),xyear=,xmonth=>}amount)

it retrieves the correct value , but it changes all the dims and expressions to the previous month disregarding selections ..

any ideas ?

advanced thanks 

0 Replies