Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
How to get the expected output column through script or front end. for jan month we need to divide all values with the first value
month1 | sal | expected output |
jan | 11 | 11 divide by 11 |
jan | 3 | 3 divide by 11 |
feb | 13 | 13 divide by 13 |
feb | 11 | 11 divide by 13 |
feb | 10 | 10 divide by 13 |
mar | 44 | 44 divide by 44 |
mar | 33 | 33 divide by 44 |
mar | 22 | 22 divide by 44 |
Regards
Hi kulwant,
Your data makes no distinction between similar months, having 2 times january, 3 times february and march.
What's the logic behind it, can you explain it a little more?
month1 | emp | sal | expected output |
jan | 1 | 11 | 11 divide by 11 |
jan | 2 | 3 | 3 divide by 11 |
feb | 1 | 13 | 13 divide by 13 |
feb | 2 | 11 | 11 divide by 13 |
feb | 3 | 10 | 10 divide by 13 |
mar | 1 | 44 | 44 divide by 44 |
mar | 2 | 33 | 33 divide by 44 |
mar | 3 | 22 | 22 divide by 44 |
l have added emp column
May be this
Table:
LOAD * Inline [
month1, sal
jan, 11
jan, 3
feb, 13
feb, 11
feb, 10
mar, 44
mar, 33
mar, 22];
Left Join
LOAD month1,FirstValue(sal) as sal1
Resident Table
Group by month1;
Noconcatenate LOAD month1,sal,sal/sal1 as sal1
Resident Table;
Drop Table Table;
May be this
Sum(sal)/Sum({<emp = {1}>} TOTAL <month1> sal)