Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All!
Appreciate, if I'm helped with, to calculate average at the script level so that I need to be able to write a nested if statement to prepare a class like (>30000, 20000-30000,10000-20000 ) etc ,based on the average computed at the script level. Since the value given is not the average the class function to be based on the average. Also, the average here should be the half of the value of each employee.
Thanks in advance
Neville
Dear Kush
Your script structure was applied & it is almost there but following script error coming while data is loaded. Please see what may causes this error?
Thanks for the reply
Invalid expression
LEFT JOIN (MAIN)
LOAD
BR_CODE,ME_CODE,
SUM(AMOUNT)/Age_in_month AS AVG_COMM
RESIDENT MAIN
GROUP BY ME_CODE,BR_CODE
Hi Kush,
Following error comes when the data are loaded. Could you please refer this & see what the error is? I tried to locate but no idea where it is connected with. 90% must be ok as the age calculation is happening as expected.
Neville
Invalid expression
LEFT JOIN (MAIN)
LOAD
BR_CODE,ME_CODE,
SUM(AMOUNT)/Age_in_month AS AVG_COMM
RESIDENT MAIN
GROUP BY ME_CODE,BR_CODE
change below
LEFT JOIN (MAIN)
LOAD
BR_CODE,ME_CODE,
SUM(AMOUNT)/max(Age_in_month) AS AVG_COMM
RESIDENT MAIN
GROUP BY ME_CODE,BR_CODE
Yet to encounter the same script error what I have noted earlier though the adjustment was done as you proposed.
can you share script?