Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 :
LOAD * INLINE [
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 :
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
but you get the same results if you put in the first textbox
=median instead of =$(median_textbox)
HI
Try like this
variable name -> median = (max(Salaray)-min(Salary))/2;
count({<SALARY={">$(median)"} >}distinct ID)
Hope that helps
I've used this: sum(if(SALARY > $median ,1,0))
see attached file
Nope, this doesn't work at all. the text box returns 0, please see attached files
You forgot to put a '=' before the calculation ( (max(SALARY) - min(SALARY) ) / 2 )
but you get the same results if you put in the first textbox
=median instead of =$(median_textbox)
great. thanks for that bit of info.
You can simply:
initialise the variable :
median=(Max(SALARY)-Min(SALARY))/2
and calculate:
=count(if(SALARY>median,SALARY))