Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

currency script

Hello

i am using qlikview 11.

i have got currency script from forum but this scrpt is working for current day ony

I.e if script is not reloaded for 2 days then currency rate of that days is not comming in qvd.

anybody have any solution so that currency rate of prevoius days will come in qvd.

i am posting my script here

pls help

T_LastDate:

LOAD

Max([End Date]) As MaxExchangeDate From HisCurrency.qvd (qvd);

Let zMaxExchangeDate = Peek(MaxExchangeDate);

DROP Table T_LastDate;

For zi = $(zMaxExchangeDate)+ 1 to Today()

    Let dd = Date(zi, 'YYYY/MM/DD');

    

    HisCurrency:

    LOAD

     Date(Today(),'YYYY/MM/DD')  As [End Date],

     [Units/1 USD]  as [USD/KES],

     [Units/1 USD] ,

     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

  

  

FROM [http://www.oanda.com/convert/fxdaily?date=$(dd)&date_fmt=us&exch=USD&lang=en&sel_list=KES&value=1&fo...]

    (html, codepage is 1252, embedded labels, table is @1);

   

 

Next zi

Concatenate (HisCurrency)

LOAD * From HisCurrency.qvd (qvd)

Where Not(Exists([End Date]));

Store HisCurrency into 'E:\Currency\HisCurrency.QVD';

0 Replies