Discussion board where members can get started with QlikView.
As part of a script I have the following lines:
'2011'&rowno() as WEEKLINK2011
'2012'&rowno() as WEEKLINK2012
WEEKLINK2011 as WEEKLINK
WEEKLINK2012 as WEEKLINK
This is working fine and generates a file that gives me 1 field that contains the value 20111, 20112, ..201153, 20121. 20122, ..201253.
So far so good.
But I try to learn the syntax and I am looking for the shorter way of doing this.
So I try something like:
for a = 2011 to 2012
$(a) & RowNo()
But the function row() counts above 53 till 106, so this doesn't work fo me.
So the question is, how to reset RowNo() to one again in the 2nd loop.
Or, and this is what I tried to achieve, what is the syntax for something like this: $(a) & (b=b+1) and reset b at the end of the loop.
Any help is welcome.
Go to Solution.
The result is two files which I then have to combine.Fine solution, no problem.But if I I would like to do this in one go?
The result is two files which I then have to combine.
Fine solution, no problem.
But if I I would like to do this in one go?
Just give your fields the same name ( you don't really want to use these anyway,right?):
$(a) & RecNo() as WeeknrKey
Thus your tables get auto concatenated.
And as already said, just add any number to recno() if you want.
Hope this helps,
try using recno() instead of rowno().
In contrast to RecNo( ), which counts the records in the raw data table, the RowNo( ) function does not count records that are excluded by where clauses and is not reset when a raw data table is Concatenation to another.
That works fine.
And is surely a shorter way.
Or, if for example I need to start not with 1 but with 100.
Is there something possible like:
Let b = 100;
for a = 2011 to 2012:
Thanks in advance.
You can use like this, recno()+100
Hope it helps
Swuehl, yes this is the shortest way and that is what I tried to find.
Thanks to the posting of Mayil I was also able to find a solution using RowNo()
$(a) & (RowNo()-$(b)) as WeeknrKey
Thanks both of you, I learned something today