Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Clone table

Hi,

A newbie question :

My script :

QUALIFY *;

UNQUALIFY DateID, "KEY_*";

REF_LIEU:

LOAD KEY_ID_LIEU,

     LEFT(Replace(VA_GEOLOC_LAT, ',' , '.'), 5)&',' &LEFT(Replace(VA_GEOLOC_LNG, ',' , '.'), 5) as CODE_URL

FROM

REF_LIEU.qvd

(qvd);

LET rowLieu = NoOfRows('REF_LIEU');

trace $(rowLieu);

for i=1 to $(rowLieu)

          let codeUrl = FieldValue('REF_LIEU.CODE_URL',$(i));

          let codeLieu = FieldValue('KEY_ID_LIEU',i);

          let vUrl = 'http://www.myweather2.com/developer/forecast.ashx?uac=gqu-Qe4J9Q&output=xml&query=' & codeUrl;

          

          trace $(vUrl);

 

          forecast:

          LOAD date,

              temp_unit,

              day_max_temp,

              night_min_temp,

              [night/weather_text],

              [night/weather_code],

              [night/wind/speed],

              [night/wind/dir],

              [night/wind/dir_degree],

              [night/wind/wind_unit],

              [day/weather_text],

              [day/weather_code],

              [day/wind/speed],

              [day/wind/dir],

              [day/wind/dir_degree],

              [day/wind/wind_unit],

              $(codeLieu) as KEY_ID_LIEU

          FROM [$(vUrl)] (XmlSimple, Table is [weather/forecast]);

next

In the loop, multiple table are created ... I would like to concatenate informations in one table

Any help please

Thanks

Labels (1)
9 Replies
Not applicable
Author

Try this?

QUALIFY *;

UNQUALIFY DateID, "KEY_*";

REF_LIEU:

LOAD KEY_ID_LIEU,

     LEFT(Replace(VA_GEOLOC_LAT, ',' , '.'), 5)&',' &LEFT(Replace(VA_GEOLOC_LNG, ',' , '.'), 5) as CODE_URL

FROM

REF_LIEU.qvd

(qvd);

for i=0 to NoOfRows('REF_LIEU')-1

          let codeUrl = peek('REF_LIEU.CODE_URL',$(i),'REF_LIEU');

          let codeLieu = peek('REF_LIEU.KEY_ID_LIEU',$(i),'REF_LIEU');

          let vUrl = 'http://www.myweather2.com/developer/forecast.ashx?uac=gqu-Qe4J9Q&output=xml&query=' & codeUrl;

         

 

          forecast:

          LOAD date,

              temp_unit,

              day_max_temp,

              night_min_temp,

              [night/weather_text],

              [night/weather_code],

              [night/wind/speed],

              [night/wind/dir],

              [night/wind/dir_degree],

              [night/wind/wind_unit],

              [day/weather_text],

              [day/weather_code],

              [day/wind/speed],

              [day/wind/dir],

              [day/wind/dir_degree],

              [day/wind/wind_unit],

              '$(codeLieu)' as KEY_ID_LIEU

          FROM [$(vUrl)] (XmlSimple, Table is [weather/forecast]);

next

Regards,

Kiran Rokkam.

Not applicable
Author

sorry but it's not working

REF_LIEU << REF_LIEU 4 lignes récupérées

forecast << weather/forecast 2 lignes récupérées

forecast-1 << weather/forecast 2 lignes récupérées

forecast-2 << weather/forecast 2 lignes récupérées

forecast-3 << weather/forecast 2 lignes récupérées

Not applicable
Author

(I'm using QlikView 11)

Not applicable
Author

move "forecast:" before "for ..."

Not applicable
Author

sorry it doesn't work too

"Unknown statement

forecast:

for i=0 to NoOfRows('REF_LIEU')-1

          let codeUrl = peek('REF_LIEU.CODE_URL',4,'REF_LIEU')"

Not applicable
Author

May be this will help you. Reload and check the log file.

If problem persists share the log file (can be generated with document properties->general->Generate log file).

Kiran Rokkam.

Not applicable
Author

OK, i find why it's not working ...

Because I qualify the table REF_LIEU

Not applicable
Author

thank you 🙂

Not applicable
Author

try :

date as Date