Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement where i need to derive column based on a specific column. for better understanding consider below example.
Trade | Level | Date | Quarter |
---|---|---|---|
1 | 2 | 30/09/2017 | 3 |
1 | 3 | 30/06/2017 | 2 |
1 | 3 | 31/03/2107 | 1 |
I need to derive status column so, in the above example Trade No = 1, for quarter 3 it need to compare the level of Quarter 2 and give it as 'TO'.
for the same trade no =1 , for quarter 2 when compared to quarter 1 as the level is same it should show same as status.
The above calculation I need in back end script.
Summary: for every trade number it should compare current qtr with previous Qtr and derive the status.
The o/p should look like:
Trade | Level | Status | Date | Quarter |
---|---|---|---|---|
1 | 2 | 30/09/2017 | 3 | |
1 | 3 | TI | 30/06/2017 | 2 |
1 | 3 | Same | 31/03/2107 | 1 |
The level should always need to be compared with previous quarter value.
Thanks,
Vivek
Message was edited by: vivek Moningi
Hi Anil,
My requirement is basically I need to compute Status based on Level Column. The criteria to compute Status is done by checking level movement ( so, when i mean level movement I check the level value for Q3 against the level value for Q2, for Q2 it will be checked against Q1 and so on) based on this i will create a flag which is Status.
Status will be like this If in Q3 , Level = 3 and Q2, level =3 then status should be Same,
Q3 , lvl= 3, Q2 =1, then status should Transfer IN
Hope this give you more insights.
Thanks,
Vivek
Can you make it clear the result set as well using differentiate another column? Probably that may help us to take
Hi Anil,
I have made the changes hope this fine.
Thanks,
Vivek
Output was okay, But for me it's not understandable. Will you explain little more to check? I am sorry for that question again
Hi Anil,
My requirement is basically I need to compute Status based on Level Column. The criteria to compute Status is done by checking level movement ( so, when i mean level movement I check the level value for Q3 against the level value for Q2, for Q2 it will be checked against Q1 and so on) based on this i will create a flag which is Status.
Status will be like this If in Q3 , Level = 3 and Q2, level =3 then status should be Same,
Q3 , lvl= 3, Q2 =1, then status should Transfer IN
Hope this give you more insights.
Thanks,
Vivek