6 Replies Latest reply on Jun 28, 2016 2:27 PM by Mia Lee

# Different Cap by Dimension

Hi, all_

I am trying to set a different cap by the dimension value. As shown/attached, all profit cap is set at 35% - meaning, if the profit is above 35% will be marked as 35%, below -35%  will be marked as -35%.

However I'd like to have a different cap for banana - if the profit is over 30%, then mark as 30%, below -30% then mark it as -30%.

So in below case, Cap(calculated field) should show 35% for apple and peach 30% for banana.

Does anyone have a good idea to implement different range set for different dimension value? (for aggregated calc)

-Mia-

• ###### 1. Re: Different Cap by Dimension

Hello - Check if this works for you. I have created two Sets on Fruits (Banana = This includes only Banana) and (Non Banana = This includes all other fruits other than Banana)

And then Changed the Formula and it worked.

1 of 1 people found this helpful
• ###### 2. Re: Different Cap by Dimension

Hello Mia,

You could write it out explicit, the calc will execute in order

IF [Fruit] = 'Banana' AND [profit %] > 0.30 THEN 0.30

ELSEIF [Fruit] = 'Banana' AND [profit %] <-0.30 THEN -0.30

ELSEIF [Fruit] = 'Banana' THEN [profit %]

ELSEIF [profit %] > 0.35 THEN 0.35

ELSEIF [profit %] < -0.35 THEN -0.35

ELSE [profit %]

END

Regards,

Rody

• ###### 3. Re: Different Cap by Dimension

Hi, Rody_

It won't work since you cannot mix non-aggregates&aggregates.

Thank you.

Mia

• ###### 4. Re: Different Cap by Dimension

Hi, Manideep!

This works like a charm! Thank you

-Mia-

• ###### 5. Re: Different Cap by Dimension

Sorry didn't realize the profit % was an aggregate

You can just modify the calc and wrap a MIN() around fruit and it will work as long as Fruit is in your vizLoD.

Regarda,

Rody

• ###### 6. Re: Different Cap by Dimension

Hi, Rody_

Fruit is a dimension. what do you mean by wrap it in a min()?

Manideep Bhattacharyya Is there a way I can have the sum of CapApplied to be 100%(=35%+30%+35%), instead of 35%?

Thanks guys.

-Mia-