# Calculated Attribute to handle range

Question asked by Sai95 on Dec 5, 2016
Latest reply on Dec 29, 2016 by Sai95

Hello

I have a requirement, where a calculated attribute  should be used to handle range. Any ideas on how this could be done?

1) Below are the details:

 Attribute Data Type Value Attribute1 Number - Attribute2 Number - Attribute 3 Calculated (Attribute 2/ Attribute1 ) * Attribute2 Publication Score Calculated When Attribute 3 =0, score is 0<5 is 2 ,<10 is 4 ,<15 is 6 ,<20 is 8 ,<25 is 10 ,<30 is 12 ,<35 is 14 ,<40 is 16 ,<45 is 18 ,<50 is 20 ,<55 is 22 ,<60 is 24 ,>60 is 26

The expression I have used for this is

Min((Absolute((Min( (Trunc(Attribute 3/5)+1)*2,26) - (Attribute 3+ 2)) * Min( (Trunc(Attribute 3/5)+1)*2,26))),Min( (Trunc(Attribute 3/5)+1)*2,26) )

But, it fails in few cases. Is there any other way to handle this range?

2) Also, can a calculated attribute be used for displaying String based on a range ?

Calculated Priority : ( When Calculated Score is >25 = Urgent,    15-25 = High,    6-14 = Medium,    <5 = Low)