Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Expression in Script

Good day

I have a data source from excel as below:

PositionValue
Qty
1ARBUE
2UYMVD
Cost
3ARBUE


i want to create a condition that creates a third column (KEY) as below:

if (Position = '', Value, 'an expression that copy the row above in KEY column')

I'm not able to find this expression or any another solution for this.

PositionValueKEY
QtyQty
1ARBUEQty
2UYMVDQty
CostCost
3ARBUECost
1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

Expression in Script

hei

use this expression in the load script

if (Position = '', Value,peek('KEY') as KEY

6 Replies
lironbaram
Honored Contributor II

Expression in Script

hei

use this expression in the load script

if (Position = '', Value,peek('KEY') as KEY

Not applicable

Expression in Script

perfect, tks!

Not applicable

Expression in Script

liron baram wrote:

hei

use this expression in the load script

if (Position = '', Value,peek('KEY') as KEY


hi.
It does not work for me.

  

Can you publish the entire script?

Thanks,
Daniel

Not applicable

Expression in Script

hi.
It does not work for me.!

Can you publish the entire script?

Thanks,
Daniel

Not applicable

Expression in Script

Hi.
It does not work for me. Can you publish the entire script?

Thanks,
Daniel

Not applicable

Expression in Script

Daniel, pls check if this can help you:

LOAD

     Position,

     Value,

     if (Position = '', Value, peek(Position)) as KEY

FROM [...]

Rgds,

Community Browser