Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
tommyl
Creator
Creator

Displaying a value according to the sums

Hello,

 

I have a requirement consisting below chart displaying Top5 customers by country:

Countrycustomer percentage(ascending order)customer count(ascending order)
Turkiye60%63
UK20%11
US5%13
...........

 

Table displays countries with the highest distinct customer counts and percentages. 

Dimension: countryName

Measure-Percentage:  num(Count({$<[customer.subscriptiondate]={"<=$(vEnd)>=$(vStart)"}>}distinct [customerid])/count(total {$<[customer.subscriptiondate]={"<=$(vEnd)>=$(vStart)"}>}distinct [customerid]), '#,##0.00%')

Measure-Count: Count( {$<[customer.subscriptiondate]={"<=$(vEnd)>=$(vStart)"}>} distinct[customerid])

The requirement is :

To display customers counts by customer segments(SME, SOHO, CORP, INDIV) but, at the initial state, if there is no countryName selection, highest valued customer counts by segments should be displayed. 

To illustrate with the above table, if no countryName is selected, within given date range(vEnd and vStart),

(if(isnull(getSelectedCount(countryName)), ....)

SMESOHOCORPINDIV
401283

 

As you can see the totals of the segments should be 63 which is the highest-customer-valued country, Turkiye. 

For this i did below (to illustrate for SME segments):

=if(isnull(GetFieldSelections([countryName])), max(aggr(count({$<[customer.subscriptiondate]={"<=$(vEnd)>=$(vStart)"}>*<[customer.segment] ={"SME"}>}distinct [customerid]),[countryName])),count({$<[customer.subscriptiondate]={"<=$(vEnd)>=$(vStart)"},[customer.segment] ={'SME'}>}distinct [customerid]))

 

But it displays not Turkiye's SME values because this formula brings "the highest valued 'SME' customer count", not the "highest valued customer count's SME value".  Instead of Turkiye, it displays the highest counted SME's value, which is not even in the TOP5 list, Russia. Because Russia has the maximum "SME-customer" count. I just want to display Turkiye's SME count, which has the maximum "customer" count. 

 

Could you please help me on this?

 

Regards,

1 Reply
tommyl
Creator
Creator
Author

Hello experts,

Anyone can help on this topic please?

Regards,

T.