Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Woojtek_96
Contributor III
Contributor III

Get value from table with particular RowNo incremented by 40

Hi all,

I want to extract values from particular rows: first and second and incremented by 40 (1,2,41,42,81,82 etc) 

Now i'm loading main table and in next loading table with resident statement, i don't know how to write where statement with incremental, I tried mod script but it dont work 

Thank for all help

 

Greeting and have a nice day!

1 Solution

Accepted Solutions
sunny_talwar

This seems to have worked for me

Table:
LOAD RowNo() as [Row Number]
AutoGenerate 1000;

FinalTable:
NoConcatenate
LOAD *
Resident Table
Where Mod([Row Number] - 1, 40) = 0 or Mod([Row Number] - 2, 40) = 0;

DROP Table Table;

So, basically if you create a field using RowNo() in your main table, you can use something like this in the resident load

Where Mod([Row Number] - 1, 40) = 0 or Mod([Row Number] - 2, 40) = 0;

View solution in original post

1 Reply
sunny_talwar

This seems to have worked for me

Table:
LOAD RowNo() as [Row Number]
AutoGenerate 1000;

FinalTable:
NoConcatenate
LOAD *
Resident Table
Where Mod([Row Number] - 1, 40) = 0 or Mod([Row Number] - 2, 40) = 0;

DROP Table Table;

So, basically if you create a field using RowNo() in your main table, you can use something like this in the resident load

Where Mod([Row Number] - 1, 40) = 0 or Mod([Row Number] - 2, 40) = 0;