Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jeckstein
Contributor

Looping every 4 rows in column

I have a column of data where the first first and second rows are dimension values and the third and fourth row are metric values. This table has a bunch of rows stacked on top of each other

I created this script

[Data]:

Load

Peek(@Value_u0,0,'rows') as [Age Group],

Peek(@Value_u0,1,'rows') as [City],

Peek(@Value_u0,2,'rows') as [Users],

Peek(@Value_u0,3,'rows') as [New Users]

Resident rows

;

Concatenate

Load

Peek(@Value_u0,4,'rows') as [Age Group],

Peek(@Value_u0,5,'rows') as [City],

Peek(@Value_u0,6,'rows') as [Users],

Peek(@Value_u0,7,'rows') as [New Users]

Resident rows

;

and this is giving me the desired output. The issue is that i need to do this for an unknown amount of rows. (or the number of rows/4).

I am having trouble putting together the syntax to loop over and over to give me the desired result.

Let me know if you need more information.

Thanks in advance!!

3 Replies

Re: Looping every 4 rows in column

jeckstein
Contributor

Re: Looping every 4 rows in column

Yes. But this post gives a better picture of what I am looking for. Your response on the other post is semi-working, but I think i need to mess with it a bit.

Re: Looping every 4 rows in column

I have checked with the data you have provided on other post. It's 100% working.

If you are saying semi-working.. I am assuming that you have different real data compare to your example.