Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show next n records in a table

I have a table containing events of different types.  What I want to do is select an event type, and then have all the events of that type shown, followed by the next n records in sequence.

Time Stamp Event Type details

0:00               A               xxxxx

0:01               X               yyyyy

0:05               B               zzzzz

0:10               A               rrrrrrrrr

0:12               F               ooooo

0.18               G               kkkkk

0:30               B               hhhhhh

For example, if I select type A, with n= 2, I'd like to see

Time Stamp Event Type details

0:00               A               xxxxx

0:01               X               yyyyy

0:10               A               rrrrrrrrr

0:12               F               ooooo

0.18               G               kkkkk

There is no pattern of event types. What follows event A could be anything.  The As and the

6 Replies
sunny_talwar

I don't understand the link between your input table and your expected output table. Will you be able to elaborate on what is your criteria to generate your output table?

Also what does n=2 means here?

Sunny

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

What you which to achieve is not clear, please explain

Anonymous
Not applicable
Author

Hi Sunny

Apologies, there was a mistake in tables.  Forget what I wrote last time. 

My input table should read:

Time Stamp Event Type details

0:00               A               xxxxx

0:01               X               yyyyy

0:05               F               zzzzz

0:06               R               yyyyyy

0:10               A               rrrrrrrrr

0:12               F               ooooo

0.18               G               kkkkk

0:30               B               hhhhhh

For example, if I select type A, with n= 2, I'd like to see

Time Stamp Event Type details

0:00               A               xxxxx

0:01               X               yyyyy

0:05               F               zzzzz

0:10               A               rrrrrrrrr

0:12               F               ooooo

0.18               G               kkkkk

For example, if I select type F, with n= 1, I'd like to see


Time Stamp Event Type details

0:05               F               zzzzz

0:06               R               yyyyyy

0:12               F               ooooo

0.18               G               kkkkk

Anonymous
Not applicable
Author

Hi Gabriel please see my response to sunindia.

marcus_sommer

If there are no other/better pattern you will need to use a rowno() as RowNo_Id in a sorted load and your expression need to link on these rowno(), maybe with variables and expressions like this:

variables:

vN = 2 // per inputbox or slider

vRowNoID = concat(RowNo_Id, ', ') &  // per expression

                      if(vN >= 1, ', ' & concat(RowNo_Id + 1, ', '), '') &

                      if(vN >= 2, ', ' & concat(RowNo_Id + 2, ', '), '')

                      ....

only({< RowNo_Id = {"vRowNoID"} >} details)

- Marcus

Anonymous
Not applicable
Author

Thanks for that suggestion. I'll give it a try.