Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
When I use the below expression in a chart, it gives an error that allocated memory exceeded
if(GetSelectedCount(%SubDimension) > 0,
SUM(TOTAL <$(=%SubDimension)> Spend),
SUM(Spend)
)
However, the below expression works
if(GetSelectedCount(%SubDimension) > 0,
SUM(TOTAL Spend),
SUM(Spend)
)
This one alone also works
SUM(TOTAL <$(=%SubDimension)> Spend)
The only problem becomes when I use the dollar sign expansion inside the total and if it is inside an if statement
TOTAL <$(=%SubDimension)>
Any idea how to fix this?
What is =%SubDimension?
Calculated Dimension?
Then it will not work... you can't use calculated dimension outside it's definition...
Provide sample data..
As I said. It works already. It is just dynamically picking up the dimension based on the selection
The only problem is that it is not working inside the if statement. Otherwise, the expression alone works pretty well
%SubDimension is coming from a field. It has the names of the dimension and when used with dollar sign, will point to the actual dimension
Hi Syed,
Why are you putting $ sign over here ? What kind of field is "%SubDimension" ?
Try Like this:
if(GetSelectedCount(%SubDimension) > 0, SUM(TOTAL <%SubDimension)> Spend), SUM(Spend))
Regards
KC
Because the %Subdimension field contains the names of the dimension. For example, Supplier, Product etc. When you use it with $ sign, it will refer to the actual dimension. For example, if you select Product from the list, it will as if a product dimension was used in the dimension field. Please read the dollar sign expansion first to understand my problem
Try below one..
if(GetSelectedCount(%SubDimension) > 0,
SUM(TOTAL <$(=Concat(DISTINCT %SubDimension,','))> Spend),
SUM(Spend)
)
Try below one..
if(GetSelectedCount(%SubDimension) > 0,
SUM(TOTAL <$(=Concat(DISTINCT %SubDimension,','))> Spend),
SUM(Spend)
)
nope..does not work
Provide sample data... or sample app. Difficult to guess and answer..