Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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!

Tags (3)
2 Replies
Not applicable

Re: Table fields and Variables

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

Re: Table fields and Variables

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?