Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tommyl
Creator
Creator

Grouping assettypes by customer

Hello,

I have a data like:

customeridassetType
1pstn
2pstn
3pstn
4adsl
1adsl
2adsl
3pstn
4adsl

 

i want to show grouping in a pie chart as below:

PSTNPSTN and ADSLADSL
121

 

i cannot solve the dimension. In order to get this grouping what should i write in dimension? i did this but the counts does not match with db:

=aggr(concat(distinct assetType,' and '), customerid)

thank you

Regards,

1 Solution

Accepted Solutions
kaanerisen
Creator III
Creator III

Hi Tommyl,

Dimenison : aggr(Concat(distinct assetType,' and '),customerid)

Measure : Count(distinct customerid)

Untitled.png

Hope it helps..

 

View solution in original post

8 Replies
Anil_Babu_Samineni

Can you rephrase the question?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Chirag2397
Contributor II
Contributor II

Hi,

Try this

Dimension:  =ValueList('adsl','adsl and pstn','pstn')

Measure: =if(ValueList('adsl','adsl and pstn','pstn')='adsl',
Count({<customerid=e({<assetType={'pstn'}>}customerid)>}customerid),
if(ValueList('adsl','adsl and pstn','pstn')='pstn',
Count({<customerid=e({<assetType={'adsl'}>}customerid)>}customerid),
Count({<customerid=p({<assetType={'adsl'}>}customerid)>*<customerid=p({<assetType={'pstn'}>}customerid)>}customerid)
))

kaanerisen
Creator III
Creator III

Hi Tommyl,

Dimenison : aggr(Concat(distinct assetType,' and '),customerid)

Measure : Count(distinct customerid)

Untitled.png

Hope it helps..

 

Vegar
MVP
MVP

@kaanerisen  solution will work. An alternative solution is to define a measure per definition (having no dimension) in your pie chart. 

MEASURES

adsl + pstn:
Count({<customerid = P({<assetType={'pstn'}>})>*<customerid = P({<assetType={'adsl'}>})>} distinct customerid)

only pstn:
Count({<customerid = P({<assetType={'pstn'}>})>-<customerid = P({<assetType={'adsl'}>})>} distinct customerid)

only adsl: 
Count({<customerid = P({<assetType={'adsl'}>})>-<customerid = P({<assetType={'pstn'}>})>} distinct customerid)

 

The benefit with @kaanerisen  solution is that you get an dimension that you can select and filter your data. The strenght of the second solution is resource efficiency, with large data sets you will find the SET analysis to calculate faster than the aggr() dimension calculation. 

tommyl
Creator
Creator
Author

Hello all,

thank you for all your responses.

All you replied works if i need the asset count. Here i need a customer labelling. Each customer should have a SINGLE label with following values:

-PSTN: If a customer has only PSTN service(no ADSL service). 

-ADSL: If a customer has only ADSL service(no PSTN service).

-PSTN and ADSL: If a customer both PSTN and ADSL service(have at least one PSTN and at least one ADSL).

Sorry if i couldnt make this more clear before. If you could help me i really appreciate. 

Regards,

 

 

kaanerisen
Creator III
Creator III

Hi Tommyl,

Actually I am pretty lost 🙂 In your post, It seem you want to get number of customers who has pstn, adsl or both and the solutions are accurate for that as you mention.

If you can share a sample data and expected output more clearly, you will get more and accurate solutions indeed 🙂

Regards,

tommyl
Creator
Creator
Author

Hello, 

Sorry for the fuzz.

I cannot provide the data due to NDA. Yet i can share my table outlines like:

Customer:

customeridnameDoBsegment
cust1sth12010-01-01SME
cust2sth21990-01-01SOHO
cust3sth31998-01-01Corporate

 

Asset:

customeridtype.... 
cust1pstn  
cust1adsl  
cust1pstn  
cust2adsl  
cust2adsl  
cust3pstn  
cust4pstn  
cust5pstn  
cust5pstn  
cust6adsl  
cust6adsl  
cust7adsl  
cust7pstn  
cust7pstn  

 

There is a requirement about displaying the count of customers as below, according to the assets they have:

-member count who has "ONLY PSTN" = 3 (customers: cust3, cust4, cust5)

-member count who has "ONLY ADSL"=2 (customers: cust2, cust6)

-member count who has "ADSL AND PSTN"=2(customers: cust1, cust7)

I hope i made it clear now 😞

Thank you for your help.

 

Regards,

 

tommyl
Creator
Creator
Author

Hello,

Thank you for all your helps, the problem was putting distinct to the measure.

I accept @kaanerisen solution since i set the dimension and measure value the same too, except the "distinct" part.

Thank you all again.