Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Table fields and Variables

In the load script, is it possible to use a field in a table after it has been created? Can I use that I field and assign it to a variable using LET?

I think this would be better presented through an example...

trans:

SELECT tr_product,

    tr_invoice,

    tr_date as "cal_date"

FROM transactions;

LET vTDate = cal_date;                 

--- after this some other load stuff follows ---

I hope you get my problem. If there is a solution to this, could you please show me? 

Appreciate your help!

2 Replies
Not applicable
Author

I think you can with the use of the "Peek" function.

For example, in your table, something like:

LET vTDate = Peek('cal_date', 0, 'trans');

Would give you the oldest date of that table. If you want the newest, just switch the 0 parameter to -1.

Hope it helps

CELAMBARASAN
Partner
Partner

Hi,

Did you mean assign the whole field( with all the field values) to a variable? or just a field name?or first or last field value?