Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
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

Re: Formula with dependence from previous value

Hi,

Check the Attachment..

Capture.JPG

6 Replies
galax_allu
Valued Contributor

Re: Formula with dependence from previous value

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);

Re: Formula with dependence from previous value

Have you tried expression with column labels.. like

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

Not applicable

Re: Formula with dependence from previous value

  The field [Current Volume] not found

Not applicable

Re: Formula with dependence from previous value

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

Re: Formula with dependence from previous value

Hi,

Check the Attachment..

Capture.JPG

Not applicable

Re: Formula with dependence from previous value

Thank you ever so much!