Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

Logic Requirement

Hi Community

I have a requirement.

See the Attachment.

Regards

Aviral

1 Solution

Accepted Solutions
Roop
Specialist
Specialist

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

View solution in original post

5 Replies
its_anandrjs

How you calculate the

New Field Requiremrnt

what is the logic for that.

Roop
Specialist
Specialist

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

aveeeeeee7en
Specialist III
Specialist III
Author

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....

Roop
Specialist
Specialist

This is the table that I am using and it works exactly as specified. I hope it helps

Roop
Specialist
Specialist

This is a copy of the output: