Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
jegadeesan
Creator
Creator

Have to show share % in stacked bar chart

Hi All,

When i am trying to show the percentage of brand share in stacked bar chart along with latest 12 months, the share of the brand for the selected period get splits over latest 12 months instead showing individual month share...

Using the below given expression to drive this...

Sum({<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth>}NVALUE)

/

(Sum(total{<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth,BRANDS>}NVALUE))*100

Can anyone help me out of this...

Regards,

Jegadeesan G

33 Replies
sunny_talwar

What is the exact issue you are running into?

jegadeesan
Creator
Creator
Author

Hi Sunny,

Share of the brands is not coming correctly for selected period.... (Eg) I have selected 2017 Feb,   the share of the brand for A is 20%, B is 70% and C is 10% but it showing for A is 4%, B is 9% and C is 11%...

It comes correct when we add the shares shown for the all latest 12 months for the above selected period..

sunny_talwar

May be this....

Sum({<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth>}NVALUE)

/

(Sum(TOTAL <IMSAsOfMonth> {<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth,BRANDS>}NVALUE))*100

jegadeesan
Creator
Creator
Author

Not working sunny.... getting the same result yet...

sunny_talwar

Would you be able to share a sample or image?

jegadeesan
Creator
Creator
Author

Share.PNG

Back to 12months from the period selected.... Selected jan 2016...

sunny_talwar

Can you give this a shot (used IMSAsOfPeriod instead of IMSAsOfMonth)

Sum({<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth>}NVALUE)

/

(Sum(TOTAL <IMSAsOfPeriod> {<IMSAsOfPeriod ={"$(='>=' & Date(AddMonths(Max(IMSAsOfPeriod), -11), 'MMM-YY') & '<=' & Date(Max(IMSAsOfPeriod), 'MMM-YY'))"},IMSFlag={'Current'},IMSAsOfYear, IMSAsOfMonth,BRANDS>}NVALUE))*100

jegadeesan
Creator
Creator
Author

Fantastic sunny.... It works... Thanks a lot... You might me knowing Hemanth Anichetty I guess.... we all working in same project...

sunny_talwar

Yes, I do....