Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Cubeset Set_Expression Character limitation

$
0
0

Hello,

I am using CUBESET to return a rank list of Customer using filter() and topcount().

Example

TopCount(filter(

Descendants([SBU].[SBU],4,self),([Europe/MiddleEast/Africa/India],[Actual],[Revenue],[USD Act])<> null),50,

abs(Sum(([Jan]:[Jul],[2013],[Direct Margin],[Europe/MiddleEast/Africa/India],[PRIOR YR]),[Measures].[USD Act])))

  1. SBU stands for Strategic Business Unit and this is dynamic meaning you can go down to a deeper level of Customers aggregation. Nearly all the element of the above formula are dynamic and this is working fine, meaning you can rank Customers by [Revenue] or [Direct Margin], Region can be either [Europe/MiddleEast/Africa/India] or [Europe] or [India] .., the YTD is dynamic also.
  2. The filter is excluding from the topcount all customers that have no revenue in the selected region. I can't use the ranking property of cubeset as the runtime is way too high if i do not filter my dataset before ranking it.

I am having trouble extending this formula to other criteria such as [Product Line] or adding additional conditions on the ranking such as above a fixed percentage of [Direct Margin] since the set_expression will exceed 255 characters and the cubeset will return a #value error. This is not coming from the concatenate as it will return the same error if I split my concatenate in two sub concatenate of less than 255 characters.

Additional notes : I have tried to use a cubeset without filter() function where the number of elements to be returned and sorted by topcount() is based on a cubesetcount which calculates the number of elements without revenue in my set so that I "outsource" the filter(). This is working but the runtime is at least four times the one I currently have using filter() and topcount() as I would infer that my topcount() has way more data to process.

Could you please tell me if there is anyway to bypass this character limitation or am I missing something ? (I learned about cubeset one month ago so I do not know all methods to execute a top customers ranking)

PS : One of the current cubeset function I am using with Concatenate

=CUBESET("aerobissas.Honeywell.com Revenue_Margin Revenue_Margin_Cube",CONCATENATE("TopCount(filter("&IF(AND(S_SBU="All",S_CBT="All",S_CBT_Team="All"),"Descendants([SBU].[SBU],4,self)",IF(S_CBT_Team<>"All","["&S_CBT_Team&"].Children",IF(S_CBT<>"All","Descendants(["&S_CBT&"],2,self)","Descendants(["&S_SBU&"],3,self)")))&",(",IF(S_Country="All","["&S_SubRegion&"]",IF(S_Country="India","[India].[India]","["&S_Country&"]")),",[Actual],[Revenue],[USD Act])<> null),50,abs(Sum(([Jan]:[",CM,"],[",CY,"],[",S_Metric,"],",IF(S_Country="All","["&S_SubRegion&"]",IF(S_Country="India","[India].[India]","["&S_Country&"]")),",[",S_Scenario,"]),[Measures].[USD Act])))"),"CRM Customer Name")

Anything with S_ means Selected and the hierachy is SBU>CBT>CBT_Team>CRM Customer Name and Region>SubRegion>Country


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>