Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Created 2 variables:
vCurrentmonth=month(DateFull)
vPreviousmonth= Month(AddMonths(DateFull,-1))
Trying to build one expression:
Sum({<MonthName={'=$(vCurrentmonth)'}>}Actual) Now the value was coming correctly for the current month.
but when given previous month variable the value was same as current month:
Sum({<MonthName={'=$(vPreiousmonth)'}>}Actual)
can please do the needful.
Logically, it looks correct. can you please add data and sample qvw file.
First of all your second expression is wrong (bad typing), it should be something like this:
=Sum({<MonthName={'=$(vPreviousmonth)'}>}Actual)
Then previous month needs to calculate the year, so that when you have for example a current date of 31/01/2015, the previous month should be 12 (December) from the previous year 2014.
Is MonthName function just Month or does it include year information as well? May be be if you can share some data, it would be much more faster and easier to help
You'll need to add something like this:
vPreviousYearMonth = {$(=Year(addmonths(max(Data),-1)))}
vPreviousmonth = Month(AddMonths(DateFull,-1))
=Sum({$<Year = {'=$(vPreviousYearMonth )'}, MonthName = {'=$(vPreviousmonth)'}>} Actual)
I think, this way you'll get what you want ![]()