Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a below set expression this is Calculates variance of max edition - previous edtion for a year
$(vpreviousVariance)= pick(($(vSlider))/12,avg({<MaxEdition={1}>}$(v12m)) -
avg({<PreviousEdition={1}>}$(v12m)),avg({<MaxEdition={1}>}$(v24m)) -
avg({<PreviousEdition={1}>}$(v24m)),avg({<MaxEdition={1}>}$(v36m)) -
avg({<PreviousEdition={1}>}$(v36m)),avg({<MaxEdition={1}>}$(v48m)) -
avg({<PreviousEdition={1}>}$(v48m)),avg({<MaxEdition={1}>}$(v60m)) -
avg({<PreviousEdition={1}>}$(v60m)))
I have different groups(ABC,DEF,XYZ...etc) now i have to extract the variance for each groupfor this am trying to write the if condition for each group like $(vpreviousVariance)= pick(($(vSlider))/12,if(GROUP1='ABC', (avg({<MaxEdition={1}>}$(v12m)) -avg({<PreviousEdition={1}>}$(v12m))),.....rest of the expression.
But its giving wrong result. So how can we combine if condition with set analysis here......
What is problem ?
Correcl Vx:
Vx=If(EditionMonth=1, '{<GROUP={"ABC"}, ModelYear={$(#=Only(ModelYear)-1)}, EditionMonth={"11"}>}','GROUP={"ABC"}, EditionMonth={"$(=$(vEdn)-2)"}>}')
Correct expression:
=round(pick(($(vSlider))/12,avg({$<Group={'ABC'}, EditionMonth = {$(#=Only(EditionMonth))}>}$(v12m)) - avg( $(vX) $(v12m) ),
avg({$<GROUP={'ABC'}, EditionMonth = {$(#=Only(EditionMonth))}>}$(v24m)) - avg( $(vX) $(v24m) ),
avg({$<GROUP={'ABC'}, EditionMonth = {$(#=Only(EditionMonth))}>}$(v36m)) - avg( $(vX) $(v36m) )))
Hi Anil,
Please find the attachment.
Regards,
Jagan.