Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Master III
Partner - Master III

hei

use this expression in the load script

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

View solution in original post

6 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

use this expression in the load script

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

Not applicable
Author

perfect, tks!

Not applicable
Author

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
Author

hi.
It does not work for me.!

Can you publish the entire script?

Thanks,
Daniel

Not applicable
Author

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

Thanks,
Daniel

Not applicable
Author

Daniel, pls check if this can help you:

LOAD

     Position,

     Value,

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

FROM [...]

Rgds,