Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to Calculate Avg of Sales. I have a data for two years, but my requirement is i should calculate avg(sales)
If selection is Current year - 3rd month then take average of 12 months in last year + upto Cur. Year 3rd month = Total 15 months sales average
Please help me to solve this issue, with a briefed expression.
Hi Sundaram
As far as I understood you requirement you could use the following expression with set analysis.
Avg ({1<Date= {'>=$(min({1<Year ={$(=Year-1)}>} Date))<=$(vMax)'}>}Sales) ===
Avg ({1<Date= {'>=$(Previous year min date)<=$(Current month Max date)'}>}Sales)
Attached is a sample QVW
Hope this solves. I have assumed the way you data looks. If you have any specific requirements do let me know.
Thanks
fahad
Hai Kalyan,
Pls send the datin the form of excel
Regards,
Chandu
Hi Sundaram
As far as I understood you requirement you could use the following expression with set analysis.
Avg ({1<Date= {'>=$(min({1<Year ={$(=Year-1)}>} Date))<=$(vMax)'}>}Sales) ===
Avg ({1<Date= {'>=$(Previous year min date)<=$(Current month Max date)'}>}Sales)
Attached is a sample QVW
Hope this solves. I have assumed the way you data looks. If you have any specific requirements do let me know.
Thanks
fahad
Hi,
Try this
=Sum({<DateFieldName={'>=$(=YearStart(Max(DateFieldName), -1))<=$(=Max(DateFieldName))'}>}Sales)/RangeSum(12 + Num(Month( Max(DateFieldName))))
Hope this helps you.
Regards,
Jagan.
Hi jagan,
Thank you, its working
Hi fahad,
Thank you very much, its working and i am very clear now
hi fahad,
i have to use both expression or any one
Hi Kalyan
You have to use the first expression.
Second is just an illustration.
Thanks
Fahad