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

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
KKumar92
Contributor III
Contributor III

Balance Stock Summary Report

Hi,

I am working on a small report, where I want to display a Balance Stock Report as Follow;

Transaction_DateBalance_Stock = 0Balance_Stock != 0Refill Duration
02/01/202104:47:00 PM-18 Hours
03/01/2021-10:30:00 AM

 

Please find the sample dataset below that I am working on;

ItemLocationDate & timeTransaction_DateTransaction_TimeTransactionQtyBalance Stock
XDek1/1/2021 12:00:00 AM01/01/202112:00:00 AMOpening Stock1010
XDek1/1/2021 10:00:00 AM01/01/202110:00:00 AMSales(2)8
XDek1/1/2021 10:30:00 AM01/01/202110:30:00 AMStock In1018
XDek1/1/2021 11:00:00 AM01/01/202111:00:00 AMSales(2)16
XDek1/1/2021 11:40:00 AM01/01/202111:40:00 AMSales(1)15
XDek1/1/2021 12:50:00 PM01/01/202112:50:00 PMSales(1)14
XDek1/1/2021 2:00:00 PM01/01/202102:00:00 PMSales(2)12
XDek1/1/2021 4:00:00 PM01/01/202104:00:00 PMSales(2)10
XDek1/1/2021 6:00:00 PM01/01/202106:00:00 PMSales(2)8
XDek1/1/2021 6:20:00 PM01/01/202106:20:00 PMSales(1)7
XDek1/1/2021 7:05:00 PM01/01/202107:05:00 PMSales(1)6
XDek1/2/2021 9:22:00 AM02/01/202109:22:00 AMSales(2)4
XDek1/2/2021 10:30:00 AM02/01/202110:30:00 AMStock In1014
XDek1/2/2021 11:00:00 AM02/01/202111:00:00 AMSales(2)12
XDek1/2/2021 11:40:00 AM02/01/202111:40:00 AMSales(1)11
XDek1/2/2021 12:50:00 PM02/01/202112:50:00 PMSales(1)10
XDek1/2/2021 2:00:00 PM02/01/202102:00:00 PMSales(3)7
XDek1/2/2021 4:00:00 PM02/01/202104:00:00 PMSales(2)5
XDek1/2/2021 4:08:00 PM02/01/202104:08:00 PMSales(3)2
XDek1/2/2021 4:47:00 PM02/01/202104:47:00 PMSales(2)0
XDek1/3/2021 10:30:00 AM03/01/202110:30:00 AMStock In1515

 

I have used the below formula to calculate the time when the Balance Stock = 0,

=aggr(if(Sum(Balance_Stock)=0, Transaction_Time), Transaction_Time)

However, I am finding it difficult to calculate the transaction time of the next Stock In.

Please advise how I could achieve the above requirement.

Labels (2)
0 Replies