Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
marcus_sommer

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

View solution in original post

1 Reply
marcus_sommer

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