Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Formula with dependence from previous value

Hi all,

I have the following table:

    

RouteStringTerminalNameRouteLineNumberLOADUNLOAD
A-B-C-D-E-FA11000
A-B-C-D-E-FB2020
A-B-C-D-E-FC31050
A-B-C-D-E-FD4515
A-B-C-D-E-FE52045
A-B-C-D-E-FF605

where I added  the column (Current Volume) with formula:

=Rangesum(Above(TOTAL Sum({< OperationName = {'LOAD'}>} Volume),0,max(RouteLineNumber)),) - Rangesum(Above(TOTAL Sum({<OperationName = {'UNLOAD'}>} Volume),0,max(RouteLineNumber)))


It works correctly and I have:

     

RouteStringTerminalNameRouteLineNumberLOADUNLOADCurrent Volume
A-B-C-D-E-FA11000100
A-B-C-D-E-FB202080
A-B-C-D-E-FC3105040
A-B-C-D-E-FD451530
A-B-C-D-E-FE520455
A-B-C-D-E-FF6050


Is it possible to add into the table one more column with values = UNLOAD / Current Volume with RouteLineNumber-1    ?

I.e. I want to receive the column with name "Share":


        

RouteStringTerminalNameRouteLineNumberLOADUNLOADCurrent Volume =Share
A-B-C-D-E-FA11000100 00
A-B-C-D-E-FB202080 20/1000,2
A-B-C-D-E-FC3105040 50/800,625
A-B-C-D-E-FD451530 15/400,375
A-B-C-D-E-FE520455 45/301,5
A-B-C-D-E-FF6050 5/51

Thanks in advance for any ideas!

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

Check the Attachment..

Capture.JPG

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Hi

try this ..

TEMP1:

LOAD RouteString,

     TerminalName,

     RouteLineNumber,

     LOAD,

     UNLOAD,

     [Current Volume],

     UNLOAD/Previous([Current Volume]) AS SHARE

   

FROM

[https://community.qlik.com/thread/217211]

(html, codepage is 1252, embedded labels, table is @3);

settu_periasamy
Master III
Master III

Have you tried expression with column labels.. like

Sum (UNLOAD) / Above ([Current Volume])

Not applicable
Author

  The field [Current Volume] not found

Not applicable
Author

Above  here doesn't work, it's "-" for all rows

settu_periasamy
Master III
Master III

Hi,

Check the Attachment..

Capture.JPG

Not applicable
Author

Thank you ever so much!