Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
rogeriobarbosa
Contributor II
Contributor II

Calculating values ​​previous row

hello, I need an expression that calculates the value of always using the previous line, is an example in excel, need to do the same in QlikView.

thank you.

10 Replies
Not applicable

look in help for Peek:

Peek('Sales')

Not applicable

Hello

Try this:

percentage adjustment * (1 + peek ('Title of the column'))

'Title of the column shall be the title of the red one in your example.

Rgds

sreenivas
Creator III
Creator III

Hi

Try this

RowNo()*(1+FieldNameB))

Not applicable

if you are doing it in the front end, ie a pivot table report use the Above() function

rogeriobarbosa
Contributor II
Contributor II
Author

hello, I need to do in the expression could not do using the above help me please

Not applicable

Try this one, it works for me:

LOAD [months years],

     [percentage adjustment],

     sale,

     if([percentage adjustment]='',1+peek(Column)) as KEY,

     Column

FROM

[Example (1).xls]

RedSky001
Partner - Creator III
Partner - Creator III

If you want this as an expression in a straight table you'll have to use above()

If you use a pivot table you'll have to use above() or before() depending on how you arrange the fields.

Assuming you want to use a straight table

Add [months years] as the dimension then add the following expresssions.

(Ensure [months years]  is sorted correctly)

sale

sum(sale)

adj

sum([percentage adjustment])

calc

if(RowNo()=1,1

  ,Above(calc) * (adj + 1)

  )

sale2

calc * sale

Mark

rogeriobarbosa
Contributor II
Contributor II
Author

Thank you, that was exactly what I need.

RedSky001
Partner - Creator III
Partner - Creator III

Please can you mark the right answer as "Correct Answer"?  I need the points for my ego

Mark