Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Adding RecNo() into Table

Good morning QV Experts!

I'm trying to find in which order records are loaded into table by using "RecNo()".

When I put "RecNo()" as comment I have about 5000 rows which is correct.

Base:

load

ListNr,

OrderPoItem,

Planned_Res,

PO_DeliveryDate

//RecNo()  <-- as comment

Resident MDTB

Order By ListNr asc,ListPos asc;

When I delete comment I have over 22 milions rows which is not correct.

Base:

load

ListNr,

OrderPoItem,

Planned_Res,

PO_DeliveryDate,

RecNo()

Resident MDTB

Order By ListNr asc,ListPos asc;

drop Table MDTB;

Do you know why numbers of rows increased?

Thanks in advence!

7 Replies

Not sure what you mean by number of rows increased, a RESIDENT load will take, if there is no WHERE clause of any type, all the rows from the previous table.

Do the Base and MDTB have the same fields? If so, the RESIDENT load is incrementing the rows in the MDTB table, and the Base table will be automatically concatenated to the previous one (MDTB). Maybe that's why the number increases?

Also, if you are using RecNo() without "AS" in any other table, which is technically possible, you are associating those two tables.

See about RecNo() and RowNo() here https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/CounterFunctio...

Highlighted
Creator
Creator

Hi,

you had probably made a bad join with synthetic key that duplicates your rows.

Try using the "AS" clause as Miguel suggests.

Highlighted

where do you read the number of rows 5000 vs. 22million from (table viewer / status bar)?

Highlighted
Contributor II
Contributor II

Hi,

There, after loading script and insert table.

Untitled.jpg

Highlighted
Contributor II
Contributor II

Thanks Miguel,

As you said, synthetic key caused that issue.

Problem solved.

Highlighted
Contributor II
Contributor II

Thanks Miguel,

As you said, synthetic key caused that issue.

Problem solved.

Highlighted

Glad it worked. Thanks for letting us know