Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Do while with variable

Hello all,

I'm trying to load data from an Iseries.

And every bookyear is in another Company and also an other filepath(accesspath)

I have an excel with Year and CompanyNumber.

Boekjaar,     BoekLib

2011     11E

2012     12E

2013     13E

2014     14E

I have only need to refresh the last 2 years (current year and CurrentYear -1)

Now I need to do a select like this

select *

FROM S0678ADT.X62FIL13EO.PBP;

and

Select *

FROM S0678ADT.X62FIL14EO.PBP;

Here is an example of my script where my BoekLib (in Yellow) is empty...

How can I fill up "BoekLib"?

DOWHILE.PNG.png

Regards,

Kris

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

$(TMP) is a string and need to write with quotes: '$(TMP)'.

- Marcus

View solution in original post

11 Replies
Highlighted
MVP & Luminary
MVP & Luminary

You could use peek('BoekLib', $(vFileNo), 'Lib') to run and read your Lib-Table.

- Marcus

Highlighted

After your FOR iinstruction write:

LET TMP = Peek('BoekLib',$(vFileNo)-1,'Lib'');

then replace your yellow BoekLib with $(TMP)

Let me know ...

Highlighted
Partner
Partner

Thanks for te response.

I've made this script but I get an error (see below)

Dow1.PNG.png

Error:

DowError.PNG.png

Highlighted
MVP & Luminary
MVP & Luminary

$(TMP) is a string and need to write with quotes: '$(TMP)'.

- Marcus

View solution in original post

Highlighted

LET vFileName = 'S0678ADT.X62FIL$(TMP)=.PBP'

Highlighted
Partner
Partner

Thanks!

But I was expecting he was only giving the yellow records...

tabeldow.PNG.png

Highlighted
MVP & Luminary
MVP & Luminary

It seems that in your Lib-Table are more/other values as you expect - perhaps you need to extend your where-clause.

- Marcus

Highlighted
Partner
Partner

It's working fine. I was linking some data in the table that wasn't matching.

Highlighted
Partner
Partner

Hi All,

Everything was working fine.

But if I try to use it for another file I get some strange things...

Fot the file PBD he is filling one table "PBD

ResultPBD1.PNG.png

If I do the same for the PBP file he is making 2 tables PBP and PBP-1

Why is he doing this

ResiltPBP1.PNG.png

And this is the excel I'm using for both the scripts

Excel.PNG.png