Skip to main content
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,

1 Solution

Accepted Solutions
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))

View solution in original post

16 Replies
sunny_talwar

Try this

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

sagarjagga
Creator
Creator
Author

Hi Sunnny,

Thanks a lot. but i have one problem, PAT Roll no . can be duplicate in particular Manager and supervisior combitions. so i need to count only distinct PAT roll no under particular Manager -> Supervisior.

although a same pat roll no can come under different manager supervisior combination but that is not the concern.

I am trying to use distinct in your set analysis but getting an error.

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

sunilkumarqv
Specialist II
Specialist II

Please share error

sagarjagga
Creator
Creator
Author

No error. it is giving me wrong value

sunny_talwar

May be try this... moved <Manager> before DISTINCT

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

anindya_manna
Partner - Creator II
Partner - Creator II

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


Above expression is finding total for distinct PAT roll No. means to say, while calculating Total of count it is at first applying distinct on PAT Roll No and returning the total.


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



it is considering 22(which is present under different Manager and supervisior as well) once

sunny_talwar

I am not sure I follow? Is there a question for me here?

sagarjagga
Creator
Creator
Author

Hi Sunny,

Me and anindya work in same team. Inadvertently i replied you from his ID

sunny_talwar

That is okay, I figured that part out... but what I am not sure about is the output you are expecting to get? Based on the sample provided... what is the numerical output you are looking to get?