Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlik Experts,
Is this a possible script?
Sub Missing_dates
For vCategorie = 1 to 5
Let vCat = PEEK('Cat',$(vCategorie),Categorieen);
For vSoort = 1 to 4
Let vSrt = PEEK('Srt',$(vSoort),Soorten);
Missing_dates:
NoConcatenate
Load
Datum as Peildatum,
text($(vCat)) as Categorie,
text($(vSrt)) as Soort
Resident Calendar;
join(Totalen) load * Resident Missing_dates;
Drop table Missing_dates;
Next vSoort
Next vCategorie
endsub
I get funny errors like this:
Syntax error
Unexpected token: ')', expected one of: '(', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', 'LITERAL_NUMBER', ...
Missing_dates:
NoConcatenate
Load
Datum as Peildatum,
text(>>>>>>)<<<<<< as Categorie,
text() as Soort
Resident Calendar
Hi Hans,
have you tried
Missing_dates:
NoConcatenate
Load
Datum as Peildatum,
text('$(vCat)') as Categorie,
text('$(vSrt)') as Soort
Resident Calendar;
BR
Martin
No, that did not work, unfortunately,
I will explain. I have two inline tables, Categorieen (filled with A, B, C, etc), and a table with Soorten, also filled with strings
I use the for-next loop to peek the records in these tables and use the result to fill a field in my Totalen table.
The Datum as Peildatum comes from my Master Calendar table. This way I can fill up missing dates in my Totalen table
Hans, have you tried running this via the Edit Script Debug tool? That is likely the best option to try to gather further information on exactly where things are failing such that you can check syntax of things, as it seems you just have a mismatch of ()'s somewhere in the code. Sorry I do not have anything better, but here is a Design Blog post on Loops as well, not sure if there will be anything there to help or not, but worth a shot...
https://community.qlik.com/t5/Qlik-Design-Blog/Loops-in-the-Script/ba-p/1473543
Regards,
Brett