Qlik Community

Qlik Sense Documents & Videos

Documents & videos about Qlik Sense.

NBP Web API - Currency exchange rates - REST Extractor (National Bank of Poland)

mike_kovi
New Contributor II

NBP Web API - Currency exchange rates - REST Extractor (National Bank of Poland)

 Hi there,

I wanted to share with You an extractor I created for NBP ( National Bank of Poland / Narodowy Bank Polski )

Basically it extracts all tables (A,B,C) of currency exchange rates from 2002-01-01  up to Date ( Today () ).

to sucesfully run this extractor you need to

  1. Create  REST connection  for example (http://api.nbp.pl/api/exchangerates/tables/A/2018-01-01/2018-03-31/) , dates are irrelevant as this URL is  changed every iteration with variable.NBP connection.pngnbp connection
  2. Create local folder connection 'Extract' - qvd files will be stored there.Extract connection.pngextract connection

     

Extractor stores :

  1. ratesA.qvd - Middle exchange rates of foreign currencies – table A
  2. ratesB.qvd - Middle exchange rates of foreign currencies – table B
  3. ratesC.qvd - Buy and sell prices of foreign currencies – table C
  4. ratesABC.qvd - concatenated tables A,B,C in one qvd
  5. restA-var.qvd - variables used with each iteration for table A
  6. restB-var .qvd- variables used with each iteration for table B
  7. restB-var.qvd - variables used with each iteration for table C 

So how it works - 

First of all API allows to query for  maximum 93 days (  3 months). First record in NBP you can download is 2002-01-01 , So I need to devide whole period between 2002-01-01 and today()) in  quoters :  2018 - 2002 = 16 *  4 = 64

then I need  count  full quarters in last year, so ( as I write this post is 2018-11-25)  so here are 3 full quarters 

So my iteratrion count  is 64 + 3 = 67  so every iteration  I ask for 3 months perioditerations.pngat this point I need to query for last not full period.  which is  min = max + 1 day , max = today()

I hope this will be usefull and saves time to some of you.

 

 

 

 

 

 

Attachments
Version history
Revision #:
1 of 1
Last update:
‎2018-11-25 04:39 PM
Updated by:
 
Contributors