Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have not used QV for a while and need some help. Do not know if it's even possible to solve my problem.
I'm trying to build my own portfolio application and would like to load historical data from a website in .csv-format. I have all the Tickernames(stock's short names) in one separate table and would like to use this one to load the historical data from the website instead of writing the LOAD-statement multiple times. Where I have "TickerName" I would like to loop the LOAD with TickerNames in a separate table. For exmaple, the load works if I change "TickerName" to "HM-B" which is the ticker name for H&M.
Will it be possible?
See below:
LOAD
Date#(quote_date,'YYYYMMDD') AS QuoteDate,
paper AS StockName,
exch,
open,
high,
low,
close,
volume,
value
FROM
[http://www.netfonds.se/quotes/paperhistory.php?paper=TickerName.ST&csv_format=csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Thanks,
Alexander
Thanks, it was helpful!
I also found Another solution using the for-loop here:
http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script
First load TickerName table, then try something like:
for i = 1 to FieldValueCount('TickerName');
Let vTickerName= FieldValue('TickerName', $(1));
LOAD
Date#(quote_date,'YYYYMMDD') AS QuoteDate,
paper AS StockName,
exch,
open,
high,
low,
close,
volume,
value
FROM
[http://www.netfonds.se/quotes/paperhistory.php?paper=$(vTickerName).ST&csv_format=csv]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Next
Thanks, it was helpful!
I also found Another solution using the for-loop here:
http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/02/loops-in-the-script