Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

wunderch
New Contributor III

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
MVP
MVP

Re: Variable for Load-Script

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)';

2 Replies
MVP
MVP

Re: Variable for Load-Script

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
New Contributor III

Re: Variable for Load-Script

Thanks! It works

Community Browser