Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Put the value of a variable in all lines of a table

Hello,

I got a problem that i really don't know how to fix.

I have a table Itab with 3 columns.

I also want to store the value of another field in a variable, so my first question is how to do this?

Where should i put the if statement in which i fill this variable?

Itab:

load [Field0_] as Division,

  [Field2_] as Magasin,

  [Field4_] as Stock

resident ZSD_PROG

where isNum([Field0_])=-1 and isNum([Field2_])=-1;

IF [Field6_] like '??.??.????' then;

  let var = [Field6_];

ENDIF;

Then, i want to store the table Itab into another table Itab2.

My problem is that i want to add a column Date and store in this column the value of my variable.

I think it must be something like that but i can't be sure because the first thing i need to do is to fill correctly my variable var.

Itab2:

load *,

$(var) as Date

Resident Itab;

Drop Table Itab;

Can anyone help me please?

Thanks,

Best Regards,

Loïc

Tags (1)
1 Solution

Accepted Solutions

Re: Put the value of a variable in all lines of a table

Firstly you need to load your variable-field into a table and then you could read it per inter-record functions into a variable, here some examples from help:

let var = peek( 'Umsatz', 0, Tabelle1 )

let var = lookup( 'Preis', 'ProduktID', ASZ123, 'Preisliste' )

- Marcus

1 Reply

Re: Put the value of a variable in all lines of a table

Firstly you need to load your variable-field into a table and then you could read it per inter-record functions into a variable, here some examples from help:

let var = peek( 'Umsatz', 0, Tabelle1 )

let var = lookup( 'Preis', 'ProduktID', ASZ123, 'Preisliste' )

- Marcus

Community Browser