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

row&rec

Hello Community,

Where exactly we can use rowno() and recno

what we can make the difference with rowno() and recno()

as am trying below scripts but both are getting same results

temp1:

LOAD Date(Today()+RowNo()) as tempdate1

AutoGenerate 10;

temp2:

LOAD Date(Today()+RecNo()) as tempdate2

AutoGenerate 10;

Below is the attachment for your reference

Kindly look at and suggest !

Thanks in adv!!

1 Solution

Accepted Solutions
Siva_Sankar
Master II
Master II

Satish,

Find the attached example with explanations. Where and How to use it.

View solution in original post

12 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Read the help in QlikView Desktop for each function. It clearly states that one function assigns a number to input rows, and the other to internal table rows (e.g. sort of output rows). Since you do not filter any rows (both tables generate and store exaclty 10 rows in each internal table) you will not notice any difference.

Use a WHERE clause to drop some rows, and you will start to see different results.

Peter

Anonymous
Not applicable

From "help":

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 concatenated to another.

Agis-Kalogiannis
Employee
Employee

The RecNo() refers to your datasource whereas the RowNo() refers to your QlikView dataset.

Siva_Sankar
Master II
Master II

Satish,

Find the attached example with explanations. Where and How to use it.

qlikviewwizard
Master II
Master II

Hi satishqlik ,

Use shankarece advise. It is perfect.

qv_testing
Specialist II
Specialist II

HI Satish,

Examples:

Raw data:

Tab1

A

B

1

aa

2

cc

3

ee


QVTab:

Load *, RecNo( ), RowNo( ) from Tab1 where A<>2;

The resulting QlikView internal table:

QVTab

A

B

RecNo( )

RowNo( )

1

aa

1

1

3

ee

3

2

Hope it Helps You....

jagan
Luminary Alumni
Luminary Alumni

Hi,

You cannot see  the difference if you are not doing any filtering or sorting?  If you use Sorting/Filtering then you will find the diffference.

Instead of inline try with data from SQL or Excel.

RowNo() - returns the sequence of current loading in a query.

RecNo() - returns the actual row number in the table, even you sort it won't change for the recors..

Regards,

Jagan.

prashantbaste
Partner - Creator II
Partner - Creator II

Hi Satish

RecNo() gives results according to input table - i.e. Record Number of particular record in input table.

RowNo() gives results on the basis of output - i.e. Row number of particular record in resulting table.

Hope this will help you to understand difference between both.

--

Regards,

Prashant P Baste

jonathandienst
Partner - Champion III
Partner - Champion III

In a preceding load situation, you cannot use RowNo() in the last load step - it has no result set to reference, so will always return 0. This will not work:

LOAD A + B As C,

  rowno,

;

LOAD A, B,

  RowNo() As rowno

From ...

And this will:

LOAD A + B As C,

  RowNo() As rowno

;

LOAD A,  B,

From ....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein