Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trying to write expressions but getting error

I am trying to count the employee, who are above or below the median salary.

The expressions I am using is as follows:

Count({<[CTC]={">="} Median({<[CTC]>} [Employee])

Please help.

24 Replies
kamal_sanguri
Specialist
Specialist

I think ">}" is missing (Set and modifier are not closed) Just before the Employee Name in the expression. May be that can be the cause expression provided by Sunny is not working..  What you think..?

kamal_sanguri
Specialist
Specialist

Try this:

count(if([CTC (USD)] > Median(<Job Level>[CTC (USD)])]),[Employee Name]))


I have modified it to take care of Job Level as well.. Pls give it a try just put the name of the column which holds the Job Level inside the angle brackets "<>".



sasiparupudi1
Master III
Master III

Please try

count(if([CTC (USD)] > aggr(Median([CTC (USD)]),[Job Type]),[Employee])

Not applicable
Author


@ Kamal: Tried this but getting expression error:

count(if([CTC (USD)] > Median([M_Grade] [CTC (USD)])]),[Employee Name]))

Just replace <Job Level> by [M_Grade].

Please check.

kamal_sanguri
Specialist
Specialist

you have to put this inside angle brackets:

like this - <[M_Grade]>

Not applicable
Author

Tried this as well but no luck 😞

count(if([CTC (USD)] > Median(<[M_Grade]>[CTC (USD)])]),[Employee Name]))

sunny_talwar

Did you try to rectify my mistake (pointed out by kamal‌?

Count({<[Employee Name] = {"=[CTC (USD)] > Median(TOTAL [CTC (USD)])"}>} [Employee Name])

Not applicable
Author

Sunny Thanks.. Now expression error has gone but the same issue which I have been asking. The given expression calculating the median of entire population then median value applicable on all job levels. Which is incorrect analysis. When I draw a graph and taking Job level on the X axis then it should count the employee who are below or above median on each job levels individually without keeping one median for all.

Hope, I may conveyed the concern. Thanks for your support and expect more on this please.

sunny_talwar

May be this:

Count({<[Employee Name] = {"=[CTC (USD)] > Median(TOTAL <[Job Level]> [CTC (USD)])"}>} [Employee Name])

Not applicable
Author

Tried this but as it was earlier:

Count({<[Employee Name] = {"=[CTC (USD)] > Median(TOTAL <[M_Grade]> [CTC (USD)])"}>} [Employee Name])

Median value remains the same for all job levels.