# New to QlikView

Discussion board where members can get started with QlikView.

Contributor III

## Calculated Expression Use as a Dimension

Hi Community,

I made some calculated expression in order to calculate the scorecard for sale hierarchy,

after calculating the score, I assign a grade against each sale representative(Expression Given below) whichi achieved successfully.

But i also want a summary of assigning grades like

Count of Excellent is 50 let suppose

Count of Satisfactory =20

and so on....

How can i do that?

if (

( [Total BSC Score] )

>= 90 , 'Excellent'

,

if (

([Total BSC Score])

>= '80' and ([Total BSC Score] ) < '90' , 'Satisfactory'

,

if (

([Total BSC Score] )

>= '70' and ([Total BSC Score] ) < '80' , 'Average' ,

if (

([Total BSC Score] )

< '70' , 'Under Performing' ) )

)

)

2 Solutions

Accepted Solutions
Honored Contributor

## Re: Calculated Expression Use as a Dimension

Can you share some sample to work upon?

This can be achieved using bucket logic in calculated Dimension.

Contributor III

## Re: Calculated Expression Use as a Dimension

Thanks, Shiveshsingh.
I implement your suggestion and its working.
Aggr(
If([Total Score] >= 90, Dual('Excellent', 1),
If([Total Score] >= '80' and ([Total Score]) < '90' , Dual('Satisfactory', 2),
If([Total Score] >= '70' and (TotalBSCScore) < '80' , Dual('Average', 3),
If([Total Score] < '70' , Dual('Under Performing', 4))))),DIM1 , DIM2)

8 Replies
Honored Contributor

## Re: Calculated Expression Use as a Dimension

Can you share some sample to work upon?

This can be achieved using bucket logic in calculated Dimension.

Contributor III

## Re: Calculated Expression Use as a Dimension

Please refer the snapshot, sample work is not available.

I calculate percentages and according to their percentage slab, I calculate the score of the individuals.

combining the score from all parameter and taking the sum of all expression's label like [A] +[B] + [C] = Total score then i calculate the  Grade like Excellent, underperforming etc.

i also create variables for that in order to use Grade as a Dimension and expression as the count of the salesperson. Partner

## Re: Calculated Expression Use as a Dimension

Hi,

You can use Set Analysis to count, for example, Excellent. You have to use this syntax:

Count({\$<[Total BSC Score] = {"=>90"}>} [Total BSC Score])

For the others you can change the syntax. For example, use {">=70 < 80"}  to count 'Average'.

Contributor III

not working.
Contributor III

## Re: Calculated Expression Use as a Dimension

Anyone else? MVP

## Re: Calculated Expression Use as a Dimension

Is [Total BSC Score] a field created in the script? If it is, why don't you just perform this in the script like this?

```If([Total BSC Score] >= 90, 'Excellent',
If([Total BSC Score] >= '80', 'Satisfactory',
If([Total BSC Score] >= '70', 'Average', 'Under Performing'))) as Ratings```

and now do this

Dimension

`Ratings`

Expression

`Count(Ratings)`
Contributor III

Hi Sunny,