Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Paula1
Creator
Creator

previous balance load table below

Need to find the previous balance and the balance by.

ordey by

Branch,

product,

Date,

Ordem

 

Ramo produtos Encontro Ordem Tipo Seq entrada saída
7 1108711806 26/01/2021 13:28 6642152 E 199979 3 0
7 1108711806 23/02/2021 15:39 6735358 S 201684 0 1
7 1108711806 03/05/2021 09:27 6914042 S 205894 0 1
7 1108711806 19/07/2021 09:49 7184126 E 212199 1 0
7 1108711806 09/08/2021 15:43 7257623 S 213854 0 1
7 1108711806 09/08/2021 15:43 7257624 S 213854 0 1
18 1108711806 26/01/2021 16:39 6639619 E 71806 3 0
18 1108711806 15/07/2021 18:12 7169434 S 85888 0 1
18 1108711806 08/10/2021 16:54 7261373 E 87937 0 2
2 8101151606 01/05/2010 19:55 455234 E 0 1 0
2 8101151606 22/04/2010 17:52 508359 E 0 0 2
2 8101151606 14/01/2011 12:16 435600 S 0 1 0

 

how i want!

 

Branch product Date Ordem Type Seq Previous input exit balance
7 1108711806 26/01/2021 13:28 6642152 E 199979 0 3 0 3
7 1108711806 23/02/2021 15:39 6735358 S 201684 3 0 1 2
7 1108711806 03/05/2021 09:27 6914042 S 205894 2 0 1 1
7 1108711806 19/07/2021 09:49 7184126 E 212199 1 1 0 2
7 1108711806 09/08/2021 15:43 7257623 S 213854 2 0 1 1
7 1108711806 09/08/2021 15:43 7257624 S 213854 1 0 1 0
18 1108711806 26/01/2021 16:39 6639619 E 71806 0 3 0 3
18 1108711806 15/07/2021 18:12 7169434 S 85888 3 0 1 2
18 1108711806 10/08/2021 16:54 7261373 E 87937 2 0 2 1
2 8101151606 05/01/2010 19:55 455234 E 0 0 1 0 1
2 8101151606 22/04/2010 17:52 508359 E 0 1 0 2 3
2 8101151606 14/01/2011 12:16 435600 S 0 3 1 0 2
Paula Santos
vitória - ES
Labels (4)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Table:

Load

Branch, product,Date,Order,Type,Seq,input,exit

,If(Product=Peek('Product'),Peek('Balance'),0)as Previous

,If(Product=Peek('Product')

         ,Peek('Balance')+input-exit 

          ,Input-exit ) as Balance

From yourdata;

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

Table:

Load

Branch, product,Date,Order,Type,Seq,input,exit

,If(Product=Peek('Product'),Peek('Balance'),0)as Previous

,If(Product=Peek('Product')

         ,Peek('Balance')+input-exit 

          ,Input-exit ) as Balance

From yourdata;

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Paula1
Creator
Creator
Author

😀 trank

Paula Santos
vitória - ES