Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends ,
I am writing below expression
(If(Dimensionality()=1 or Dimensionality()=0,
sum({StateB<_GHQFlg=,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month>}$(vMetricBU_B_RM)),
sum({StateB<_GHQFlg=$::_GHQFlg,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month>}$(vMetricBU_B_RM))))
and variable has below expression
vMetricBU_B_RM:
=(If(Only({StateB}[KPI 22])='Total Volumes1','VOL___ORGANIC_GROWTH_RM','FIN___ORGANIC_GROWTH_RM'))
I am getting below error ,
Error: Error in expression: Sum takes 1 parameter
Please help to correct this.
Thanks
I think since you are using Only() function in your variable, you are basically using an aggregation within an aggregation. This might only work with a use of Aggr() function. Do you have a sample you can share with the expected output to help you better?
Sorry sunny , application is at client location but i have also tried with
=(If(MAx({StateB}[KPI 22])='Total Volumes1','VOL___ORGANIC_GROWTH_RM','FIN___ORGANIC_GROWTH_RM'))
but still is was showing same error ,
Max, Min, Sum, Avg, Only are all Aggregation functions and you cannot do
Sum(If(Max(.....)) or Sum(If(Only(...))
You need to do this
Sum(Aggr(If(Max(....)))
Does this make sense?
I have tried like this
=sum(If(Aggr(Max({StateB}[KPI 22]),[KPI 22])='Total Volumes1','VOL___ORGANIC_GROWTH_RM','FIN___ORGANIC_GROWTH_RM'))
it is giving 0
May be try this without variable -
=If(Dimensionality()=1 or Dimensionality()=0,
sum({StateB<_GHQFlg=,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month,[KPI 22]={'Total Volumes1'}>}VOL___ORGANIC_GROWTH_RM),
sum({StateB<_GHQFlg=$::_GHQFlg,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month,[KPI 22]={"[KPI 22]<>'Total Volumes1'"}>}FIN___ORGANIC_GROWTH_RM))
Set analysis syntax should be sum({<>} sales)
But, in your expression
(If(Dimensionality()=1 or Dimensionality()=0,
sum({StateB<_GHQFlg=,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month>}$(vMetricBU_B_RM)),
sum({StateB<_GHQFlg=$::_GHQFlg,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month>}$(vMetricBU_B_RM))))
Can I know the reason why stateb indicates as current or all selections
Thanks ,
But in your first part
=If(Dimensionality()=1 or Dimensionality()=0,
sum({StateB<_GHQFlg=,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month,[KPI 22]={'Total Volumes1'}>}VOL___ORGANIC_GROWTH_RM),
sum({StateB<_GHQFlg=$::_GHQFlg,ACTUALITY_KEY={'AC'},VARIANCE_BASE_SK={'BU'}, Year=$::Year,Month=$::Month,[KPI 22]={"[KPI 22]<>'Total Volumes1'"}>}FIN___ORGANIC_GROWTH_RM))
You have retten only for VOL , but i need to change here also based on condition if KPI 22 is not total volumes1 then i need to used FIN___ORGANIC_GROWTH_RM
Thanks,
Yes it is written correctly i think , but expression pointing to StateB , that's why we have written like this , please provide any easy solution if you have
I agree with Sunny but the error message indicates that the variable expansion somehow creating two parameters to SUM function. Can you try '=' sign like $(=vMetricBU_B_RM), may be it will first calculate it before expansion.