Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi:
I need to calculate market share for a trend chart.
The conditions are as follows:
1. The user will be able to select:
a. Year
b. Month
from two list boxes.
2. Based on the user selection market share for last 13 months will be populated.
At first place I tried the following expression:
Sum({<year=,PeriodDate={">=$(=AddMonths(Max(PeriodDate),-12)) <=$(=Max(PeriodDate))"}>} CValue)
/
Sum({<year=,PeriodDate={">=$(=AddMonths(Max(PeriodDate),-12)) <=$(=Max(PeriodDate))"}>} total CValue)
But it was summing denominator for all the 13 time periods.
Then I tried the following expression:
Sum({<year=,PeriodDate={">=$(=AddMonths(Max(PeriodDate),-12)) <=$(=Max(PeriodDate))"}>} CValue)
/
Sum(total <PeriodDate> CValue)
In this case the denominator is for the latest period.
Looking forward.
Shafi
Hi ahammadshafi,
If you got the things, Please close the thread by selecting Mark As Answered.
Hi Everyone:
Many thanks for your kind help.
We could manage to come up with the correct expression:
Sum({<year=,PeriodDate={">=$(=AddMonths(Max(PeriodDate),-12)) <=$(=Max(PeriodDate))"}>} CValue)
/
Sum({<year=,PeriodDate={">=$(=AddMonths(Max(PeriodDate),-12)) <=$(=Max(PeriodDate))"}>} total <PeriodDate> CValue)
Shafi