13 Replies Latest reply: Aug 7, 2017 5:14 AM by Tresesco B

# Formula as dimension

I have the following expression in the front end:

count({<STATUS_CD=13>}OP)/count(CLAIM_NO)

I need the output of the above expression to be bucketized into 5 buckets of 20% each. Then i have to use that dimension in a chart. I tried using a variable but not able to apply.

Help appreciated!

• ###### Re: Formula as dimension

count({<STATUS_CD={13}>} OP)/count(CLAIM_NO)

Note - How you want to show bucket. Can you explain little more

• ###### Re: Formula as dimension

so this is formula to calculate HR. The result will be in percentage so i want to have buckets of percent and show how many case falls in each of the bucket. so how many cases are there for my HR in 0-20% and so on.

• ###### Re: Formula as dimension

May be like:

Class(Aggr(count({<STATUS_CD={13}>}OP)/count(CLAIM_NO), YourDimension), 0.2)

• ###### Re: Formula as dimension

You want me to this in the front end as calculated dimension or through resident load in the script?

• ###### Re: Formula as dimension

Front-end?

• ###### Re: Formula as dimension

Sorry if there is any confusion. So i have to use it in the script right?

• ###### Re: Formula as dimension

You CAN do it in front-end itself.

• ###### Re: Formula as dimension

its working just fine. Thanks a lot. One more thing i want to label the different classes accordingly. How can i do that?

• ###### Re: Formula as dimension

You can probably do so using string manipulation functions. Try to share a sample explaining your expected output, may be I could help better.

• ###### Re: Formula as dimension
0 <= x <0.2
0.2 <= x <0.4
0.4 <= x <0.6
0.6 <= x <0.8
0.8 <= x <1
1 <= x <1.2

I got above from the class definition.

i want the following:

0-20%
20-40%
40-60%
60-80%
80%-100%

I want the last 2 to be clubbed to 80-100%. Is it possible? I tried using if while creating dimension.

• ###### Re: Formula as dimension

Since this class number is limited, you could try like:

vExpression=Aggr(count({<STATUS_CD={13}>}OP)/count(CLAIM_NO), YourDimension)  // '=' symbol might not be required before variable definition

If( (vExpression)>0.8, '>80% and above' ,

If( (vExpression)>0.6, '>60-80%' ,

If ( (vExpression)>0.4, '>40-20%',

if( (vExpression)>0.2, '>20-40%', '<=20%' ))))