Discussion Board for collaboration related to QlikView App Development.
i am using qlikview v11.
i got currency script from forum that i have pasted below.but it showing script error . this error might be of peek function.
Let zMaxExchangeDate = peek('MaxExchangeDate');
zMaxExchangeDate showing null.
I have attach error msg pls find
max([End Date]) As MaxExchangeDate
DROP Table T_LastDate;
For zi = zMaxExchangeDate + 1 to Today()
Let dd = Date(zi, 'MM/DD/YY');
Date(Today()) as [End Date],
[Units/1 USD] as [USD/KES],
Year(Today()) as Year,
Month(Today()) as Month,
Day(Today()) as Day,
Week(Today()) as Week,
WeekYear(Today()) & '-' & Num(Week(Today()),'00') as RollingWeek,
Weekday(Today()) as WeekDay,
Date(MonthStart(Today()),'YYYY-MM') as RollingMonth,
Right(year(Today()),2) & '-Q' & ceil(Month(Today())/3) as [YearQtr],
'Q' & Ceil(Month(Today())/3) as Quarter
(html, codepage is 1252, embedded labels, table is @1);
LOAD * From HisCurrency.qvd (qvd)
Where Not(Exists([End Date]));
Store [HisCurrency] into HisCurrency.QVD;
I would usually do this in a while loop instead of a for loop. Something like this:
SET zi = zMaxExchangeDate;
DO WHILE zi < Today()
LET zi = zi + 1;
Use this one.
Num(max([End Date])) As MaxExchangeDate
Let vDateMin = Num(MakeDate(2010,4));
Let zMaxExchangeDate = if(IsNull(Num(peek('MaxExchangeDate',0,'T_LastDate'))),Num(MonthEnd(Today())),peek('MaxExchangeDate',0,'T_LastDate'));
Date($(vDateMin) + IterNo() - 1, '$(DateFormat)') as Date,
Date($(vDateMin) + IterNo() - 1, '$(DateFormat)') as DocDate,
WHILE $(vDateMin)+IterNo()-1<= $(zMaxExchangeDate);
Thank u for replaying
i have fixed the issue.