Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table and I am trying to get the current vs previous month volume numbers side by side. I am getting "0"' for the Prior month measure. I am not sure what I am doing wrong..
[ProductionDate.Calendar.YearMonth], [Volume] , [Previous Month Volume]
2016-Jan, 121, 0
2016-Feb, 132,0
[Previous Month Volume]:
SUM( { $<
[ProductionDate.Calendar.Year] = { $(=Year (addmonths(ProductionDate,-1))) } ,
[ProductionDate.Calendar.Month] = { $(=Month(addmonths(ProductionDate,-1))) }
>} Volume )
Attached is the sample .qvf
Regards
Hi Marco Barroso,
Please find the attached qvf and let me know if you have any questions.
Thanks
Mouna
I had looked into "above(sum(Volume))" alternative, however the solution is constrained on the scope of what you can view on the table. For instance, if you filter a row for a month, the prior period will be NULL. Also there is the issue if you sort on the ProductionDate column.
I got it, Please find the attached qvf file. I think this should work as you expected.
HI Marco,
I think it will work for you:
SUM( { $<
[ProductionDate.Calendar.Year] = { $(=Year (addmonths(ProductionDate),-1)) } ,
[ProductionDate.Calendar.Month] = { $(=Month(addmonths(ProductionDate),-1)) }
>} Volume )
Thanks,
Arvind Patil
HI Marco,
Also try this one:
SUM( { $< [ProductionDate.Calendar.Month] = { $(=addmonths(ProductionDate),-1) }
>} Volume )
Thanks,
Arvind Patil
Thank you. This did the trick, but why would this expression not work ? It appears the syntax is correct..
SUM( { $<
[ProductionDate.Calendar.Year] = { $(=Year (addmonths(ProductionDate,-1))) } ,
[ProductionDate.Calendar.Month] = { $(=Month(addmonths(ProductionDate,-1))) }
>} Volume )
I think it is better o go with peek funtion in the back end
I am not sure whats wrong with the above expression. Any ways if it is helpful please close the threat by marking it correct.
Thanks
Mouna Chandra