Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
How do i calculate the variable in previous year.
Eg:
Vbsc = sum(if(billunit=3,Qty))* sum(if(billunit=5,Rate))
if i use the variable in following condition, its not working.
Current year = sum({$<year={$(=max(year))}>}Vbsc) - its working
Previous = sum({$<year={$(=max(year))}>}Vbsc) - not working
Can any one help me.
Regards,
Antony.
Hi,
I don't see any differences between current and previous year. Anyway, try this:
Previous = sum({$<year={$(=max(year))-1}>}Vbsc) - not working
Hi,
Problem not in my condition, problem in variable.
variable is not giving the correct output for previous year, its showing my current year output in previous year.
The problem is your expression because you are summing the same year. Add a -1 to the variable.
Hi ,
Thanks for your reply...
Can u tel me how ?? i did not understand...
Hi,
Suppose you have year such as 2008,2009,2010,2011,2012
=Max(Year) gives 2012
=max(Year)-1 gives 2011
So,
= sum({$<year={$(=max(year)-1)}>}Vbsc) give result for previous year
Hope it helps