Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community
I have a requirement.
See the Attachment.
Regards
Aviral
The key to this is to reverse the order and this then produces what you require:
Staff:
LOAD
Joining,
Leaving,
MOB,
date#('01 ' & CommonMonth & ' ' & CommonYear, 'DD MMM YY') as DateValue,
CommonMonth,
CommonYear
FROM [Logic Requirement.xlsx]
(ooxml, embedded labels, table is Sheet1) ;
NewStaff:
Load *,
if(RecNo() = 1,
MOB,
NumSum(MOB, Peek(CumMOB)) - Previous(Joining) + Previous(Leaving)
) as CumMOB
resident Joiners
order by DateValue desc;
Drop Table Staff;
Hope this helps
How you calculate the
New Field Requiremrnt |
what is the logic for that.
The key to this is to reverse the order and this then produces what you require:
Staff:
LOAD
Joining,
Leaving,
MOB,
date#('01 ' & CommonMonth & ' ' & CommonYear, 'DD MMM YY') as DateValue,
CommonMonth,
CommonYear
FROM [Logic Requirement.xlsx]
(ooxml, embedded labels, table is Sheet1) ;
NewStaff:
Load *,
if(RecNo() = 1,
MOB,
NumSum(MOB, Peek(CumMOB)) - Previous(Joining) + Previous(Leaving)
) as CumMOB
resident Joiners
order by DateValue desc;
Drop Table Staff;
Hope this helps
Thanks Rupert
It is giving me desired Output.
When I am applying your logic in my Application it is not Working?
I don't know why this is happening....
This is the table that I am using and it works exactly as specified. I hope it helps
This is a copy of the output: