7 Replies Latest reply: Sep 28, 2012 11:04 AM by bobbyraj santhiogu

# set analysis and variable

Hello everyone,

Well I get an issue, and I've been woking on it since yesterday, and it's starting to give me a headache....

Here's the thing :

I've got a table with 2 columns :

ID, SALARY

1,1234

2,4567

3,5467

4,904

5,3456

6,2123

];

I created a variables which is \$(median) = (max(SALARY)-min(SALARY))/2

Now I want to count how many id's which have a salary over and below this variable

I tried :

• count({<SALARY={">\$(median)"} >}distinct  ID) -> It's not working.
• count({<SALARY={' >\$(median)'} >}distinct  ID) -> It's not working either. (simple quote)

I've tried many more things I saw in the forum, but no conclusive results.

I really need eveyone's help,

Wish you all the best,

Will

• ###### Re: set analysis and variable

HI

Try like this

variable name -> median = (max(Salaray)-min(Salary))/2;

count({<SALARY={">\$(median)"} >}distinct  ID)

Hope that helps

• ###### Re: set analysis and variable

Nope, this doesn't work at all. the text box returns 0, please see attached files

• ###### Re: set analysis and variable

You forgot to put a '=' before the calculation ( (max(SALARY) - min(SALARY) ) / 2   )

• ###### Re: set analysis and variable

but you get the same results if you put in the first textbox

• ###### Re: set analysis and variable

great. thanks for that bit of info.

• ###### Re: set analysis and variable

I've used this: sum(if(SALARY > \$median ,1,0))

see attached file

• ###### Re: set analysis and variable

You can simply:

initialise the variable :

median=(Max(SALARY)-Min(SALARY))/2

and calculate:

=count(if(SALARY>median,SALARY))