Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ahammadshafi
Creator
Creator

Market share trend chart

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

11 Replies
qlikviewwizard
Master II
Master II

Hi ahammadshafi,

If you got the things, Please close the thread by selecting Mark As Answered.

ahammadshafi
Creator
Creator
Author

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