Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Imagine a internet site have from 1 to 50 pages, each of them ends with ID=number (1 - 50).
Some of them (for example 4,18,27,43) have the info I need, another don't have it.
So Could you please tell me how to make FOR cycle only for the pages that have the needed info? I've chech all of them and use applymap function to load only from the needed pages.
1. check all pages which have the needed page
2. usinf for a=1 to 50
load ...
....
from a
where applymap ();
In this example all of the pages have been opened once again that is unwanted and slow down the reload time , so want to load only from the needed page (4,18,27,43)
HOW TO DO THAT? 🙂
Thanks!
Not agree !
Create a lookup table
Load * Inline [
I , Page
1 , 4
2 , 18
3 , 27
4 , 43] ;
Then you can loop only with the pages you want to access
For i=1 to 4 ;
let v = FieldValue('Page',$(i));...
Use Fieldvalue function.
Example
marker:
LOAD name,
number,
address,
fullAddress,
lat,
lng,
open,
bonus
FROM(XmlSimple, Table is [carto/markers/marker]);
let vCounter = fieldvaluecount('fullAddress');
for i=1 to $(vCounter) ;
let vExcelFieldValue = FieldValue('fullAddress',$(i)); //pull the actual URL from position i in the excel file
station:
LOAD
@1,
@2,
@3 as Lat,
@4 as Long
FROM
[http://maps.google.com/maps/geo?q=$(vExcelFieldValue)+fr&output=csv&oe=utf8&sensor=false&key=ABQIAAAATndsWAV5Q2y7pRRi-22W_hTxw9fvAnrsiYejTsRxd4b0cj9HKxSNCXUxAANaoACDzXWznNLVPto_jA]
(txt, codepage is 1252, explicit labels, delimiter is ',', msq);
next i ;
hope it helps you
tnx, but in your case it will load all the pages from 1 to 50 ! I need to load only the 4,18,27,43 for example!!!
Not agree !
Create a lookup table
Load * Inline [
I , Page
1 , 4
2 , 18
3 , 27
4 , 43] ;
Then you can loop only with the pages you want to access
For i=1 to 4 ;
let v = FieldValue('Page',$(i));...
Yeah, You're right! Thanks a lot! 🙂 It works !!!