Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wunderch
Creator
Creator

Variable for Load-Script

Hi guys,

I have the following problem:

I want to load a table with a date Variable from another table. So I think the script must be something like this:

Load

Date

from TABLE A;

set vLOADDATE = Date;

Load

DATE_PRICE,

*

from TABLE B where DATEPRICE = $(vLOADDATE)

But when I make it like this the vLOADDATE is empty.

Can anyone help me?

Thanks!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

If you want to assign a single record value of field Date to a variable, you need to use inter record functions like Peek().

For example, to retrieve the first Date field value in your [Table A] table:

LET vLOADDATE = Peek('Date',0,'TABLE A');


or to get the last record value:


LET vLOADDATE = Peek('Date',-1,'TABLE A');


Depending on the Date format, you would then need to use


Load

DATE_PRICE,

*

from TABLE B where DATEPRICE = '$(vLOADDATE)';

View solution in original post

2 Replies
swuehl
MVP
MVP

If you want to assign a single record value of field Date to a variable, you need to use inter record functions like Peek().

For example, to retrieve the first Date field value in your [Table A] table:

LET vLOADDATE = Peek('Date',0,'TABLE A');


or to get the last record value:


LET vLOADDATE = Peek('Date',-1,'TABLE A');


Depending on the Date format, you would then need to use


Load

DATE_PRICE,

*

from TABLE B where DATEPRICE = '$(vLOADDATE)';

wunderch
Creator
Creator
Author

Thanks! It works