Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Setting the Maximum value of a field in the script

Hi everyone!

In the LOAD script, I have this...

---------------------------------------------------------------------

transactions:

transID,

transNo,

transCalendarDate,

transFiscalDate;

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

---------------------------------------------------------------------

Now, after loading everything to "transactions", what I wanted to do through script is to:

1. assign the maximum transCalendarDate to a variable vMaxCal

2. assign the maximum transFiscalDate to a variable vMaxFiscal

Advance thank you for all of your replies!

1 Solution

Accepted Solutions

Re: Setting the Maximum value of a field in the script

Transactions:

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

Temp:

load

    max(trn_calendarDate) as maxCDate

    ,max(trn_FiscalDate) as maxFDate

resident Transactions;

LET vMaxCal = peek('maxCDate');

LET vMaxFiscal = peek('maxFDate');

drop table Temp;


talk is cheap, supply exceeds demand
2 Replies

Re: Setting the Maximum value of a field in the script

Transactions:

SQL SELECT

     trn_uid,

     trn_no,

     trn_calendarDate,

     trn_fiscalDate

FROM transact;

Temp:

load

    max(trn_calendarDate) as maxCDate

    ,max(trn_FiscalDate) as maxFDate

resident Transactions;

LET vMaxCal = peek('maxCDate');

LET vMaxFiscal = peek('maxFDate');

drop table Temp;


talk is cheap, supply exceeds demand
Not applicable

Re: Setting the Maximum value of a field in the script

Thank you Gysbert!!!

Community Browser