Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sagarjagga
Creator
Creator

Bar chart creation using particular fields from dimensions

Hi All,

I am facing a challenge to create a bar chart using 2 dimensions for below data set.

   

ManagerSupervisior                                                     PAT Roll No
AnindyaABC1
AnindyaABC11
AnindyaABC22
AnindyaABC33
AnindyaDEF10
AnindyaDEF10
MehtabABC33
MehtabFED44
SagarABC21
SagarFED33

I need to create bar chart only for Anindya and sagar who are under manager and for supervisiors ABC,FED and bar chart should be 'grouped bar chart' and it should show share of count of 'PAT Roll No' under supervisior and manager dimension in respective bars. for example count of PAT roll no in Anindya in ABC and FED is 4(as there is no FED for anindya) so ABC bar chart will show 100%(4/4) and for FED it will be 0%

Then for sagar count of pat roll no under ABC and FED is 2(1+1) so 50% for ABC bar(1/2) and 50% for FED bar(1/2)


Thanks,

16 Replies
sagarjagga
Creator
Creator
Author

ManagerSupervisiorPAT Roll No
AnindyaABC1
AnindyaABC11
AnindyaABC22
AnindyaABC1
AnindyaABC22
AnindyaABC33
AnindyaFED1
AnindyaDEF10
AnindyaDEF10
MehtabABC33
MehtabFED44
SagarABC22
SagarFED33

    

ManagerSupervisiorCount Distinct PAT Roll NoPercentage of Share
AnindyaABC44/5=80%
AnindyaDEF11/4=20%
SagarABC11/2=50%
SagarFED1

1/2=50%

I am finding out the share of ABC,DEF in ABC and DEF for these two managers. but by using previous denominator expression Total for Anindya -> ABC,DEF is coming 4(because it is counting PAT roll no1 as single unit but it should have calculate PAT roll no 1 from FED as well).

sagarjagga
Creator
Creator
Author

ManagerSupervisiorCount Distinct PAT Roll NoPercentage of Share
AnindyaABC44/5=80%
AnindyaDEF11/5=20%
SagarABC11/2=50%
SagarFED1

1/2=50%

Final chart or table

sagarjagga
Creator
Creator
Author

Sorry in previous replies i baffled in FED and DEF

Manager

SupervisiorPAT Roll No
AnindyaABC1
AnindyaABC11
AnindyaABC22
AnindyaABC1
AnindyaABC22
AnindyaABC33
AnindyaFED1
AnindyaDEF10
AnindyaDEF10
MehtabABC33
MehtabFED44
SagarABC22
SagarFED33

  

ManagerSupervisiorCount Distinct PAT Roll NoPercentage of Share
AnindyaABC44/5=80%
AnindyaFED11/4=20%
SagarABC11/2=50%
SagarFED1

1/2=50%

I am finding out the share of ABC,DEF in ABC + FEDfor these two managers. but by using previous denominator expression Total for Anindya -> ABC,DEF is coming 4(because it is counting PAT roll no1 as single unit but it should have calculate PAT roll no 1 from FED as well).

sunny_talwar

How is 1/4 = 20%? is it 1/5 or are you looking to get 25%?

sagarjagga
Creator
Creator
Author

1/5 = 20%

ManagerSupervisiorCount Distinct PAT Roll NoPercentage of Share
AnindyaABC44/5=80%
AnindyaFED11/5=20%
SagarABC11/2=50%
SagarFED1

1/2=50%

I am finding out the share of ABC,FED in ABC + FED for these two managers. but by using previous denominator expression Total for Anindya -> ABC,FED is coming 4(because it is counting PAT roll no1 as single unit but it should have calculate PAT roll no 1 from FED as well).

sunny_talwar

Try this

Count(DISTINCT {<Supervisior = {'ABC', 'FED'}, Manager = {'Anindya', 'Sagar'}>}[PAT Roll No])/

Sum(TOTAL <Manager> Aggr(Count(DISTINCT {<Supervisior = {'ABC', 'FED'}, Manager = {'Anindya', 'Sagar'}>}[PAT Roll No]), Manager, Supervisior))

sagarjagga
Creator
Creator
Author

Hi Sunny,

You are genius and so much helpful.

Thanks for the help