Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kaushi2020
Creator III
Creator III

How to calculate percentage contribution of each segment

I have a stacked bar chart where i am showing Segments as High-high, High, Medium, Low and others.

These segments are used as  a master item with a if wildmatch

=if(WildMatch(SkillsetName,'*HH*'), '1. High High',
if(WildMatch(SkillsetName,'*H*'), '2. High',
if(WildMatch(SkillsetName,'*M*'),'3. Medium',
if(WildMatch(SkillsetName,'*L*'),'4. Low',
'5. Others'))))

I am using below expression to calculate count of each segment.

(count({$<Year=, Month=, Day=,Contact_Center={'121'},Call_Abd_Flag={'Call Answered'},
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
SequenceID))

 

now how i can convert this segment label from numbers to percentage contribution by each segment per day - so that when I add these percentage, it add to 100.

Below is current view. 

kaushi2020_0-1697003547601.png

 

 

 

3 Replies
kaushi2020
Creator III
Creator III
Author

When I added the same in a table with below expression for % it's working well. 

 

kaushi2020_0-1697007872605.png

 

 

((count({$<Year=, Month=, Day=,Contact_Center={'121'},Call_Abd_Flag={'Call Answered'},
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
SequenceID)))
/
((count(total{$<Year=, Month=, Day=,Contact_Center={'121'},Call_Abd_Flag={'Call Answered'},
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
SequenceID)))

 

 

Chanty4u
MVP
MVP

try this

Count({$<Year=, Month=, Day=, Contact_Center={'121'}, Call_Abd_Flag={'Call Answered'},
Date={">=$(=Date(monthstart(Max(Date))))<=$(=Date(Max(Date)))"}>} SequenceID)
/
Aggr(Count({$<Year=, Month=, Day=, Contact_Center={'121'}, Call_Abd_Flag={'Call Answered'},
Date={">=$(=Date(monthstart(Max(Date))))<=$(=Date(Max(Date)))"}>} SequenceID), SkillsetName)

kaushi2020
Creator III
Creator III
Author

thanks for the reply. but it worked with below one. 
((count({$<Year=, Month=, Day=,Contact_Center={'121'},Call_Abd_Flag={'Call Answered'},
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
SequenceID))
/
Day(max(Date)))
/
((count(total<Day>{$<Year=, Month=, Day=,Contact_Center={'121'},Call_Abd_Flag={'Call Answered'},
Date={">=$(=date(monthstart(max(Date))))<=$(=date(max(Date)))"}>}
SequenceID))
/
Day(max(Date)))