Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator III
Creator III

first in frist out

hi  can anyone help me

i have a table like below

type    id      date                amount

rec      1      1/4/2015            5000

rec       2     1/5/2015            6000

pay      1      1/6/2015           2000

rec      3       1/7/2015           1000

pay      2       1/8/2015            8000

i need o/p like this

recID  pay ID   amount

1          1             2000

1           2             3000

2           2             5000

14 Replies
MVP
MVP

Where is recID nad pay ID in your input Table? Can you clarify little more on your requirement?

Creator III
Creator III

hi manish

its in type recid

                payid

MVP
MVP

Yes but need to understand the logic how you are getting the output table !

Creator III
Creator III

i want payment id against received id

case1 received   amount , 5000   but payment     is 2000 so u left with 3000 this is for id 1 that's y the received id and payment id is 1

                                       8000 need to be payed but u got 3000 in id 1 so go for next id 2 there u received 6000 and payed rest 5000 left with 1000 remaining two entries will be

recid    paymentid   amount

1          2                3000

2           2               5000

















   

MVP
MVP

i need o/p like this

recID  pay ID   amount

1          1             2000

1           2             3000

2           2             5000

The 1 ,1 have 2000 is that correct?

Creator III
Creator III

yes correct what u said

MVP
MVP

I am confused... as per your explanation..

type    id      date                amount

rec      1      1/4/2015            5000

rec       2     1/5/2015            6000

pay      1      1/6/2015           2000

rec      3       1/7/2015           1000

pay      2       1/8/2015            8000

rec ID     pay ID       amount Left

1               1                    5000 - 2000 = 3000

1               2                      3000 + 6000 - 8000 = 1000

How you are getting 2000, 3000, 5000?

Sorry but until the logic and your expected output is not clear for me, can't work on this script...!

Creator III
Creator III

Hi Manish,

Let us consider this to be a transaction.Where my payment amount is being subtracted from the receiving amount.

If there is a remainder in the amount subtracted, then we use it to subtract the payment amount of the second ID (2). We subtract the payment amount from remainder amount of ID '1'.

For the payment amount that remains from subtraction from the remainder amount of ID '1', then we make use of the received amount of ID '2' to subtract the remaining payment amount of ID '2'. and so on......

Let me know if you need

Master III
Master III

please post your data file