Skip to main content
Announcements
Product Release Webinar: Qlik Insider airing December 6! REGISTER TODAY!
cancel
Showing results for 
Search instead for 
Did you mean: 
cristian_av
Creator III
Creator III

IDs not matching with Rowno()

Hi


I'm trying to use Rowno() as a key in a table that I need to "split" the fields. I have a fact table called "Datos" and a second table related called "DatosDetail".

The table datos is loaded in Script 1 and stored to a qvd. Then, in script 2, I want to load the same table but splitted. To connect this splitted data, i'm creating a key with the function rowno(). As far as I know, is that the function rowno() creates a the dame key for each row.

But this is not working, and I don't know why, because the fields are getting different row number in each table.




Hope somebody can explain me why this is not working.

Thanks!


Script1:

Datos:

Origen,

[Tipo Venta],

...;

SQL Select * from exampletable;

Store Datos Into Datos.qvd (qvd);


Script2:

Datos:

LOAD 'DW'&RowNo() as %LlaveWeekPrograma,

Origen,

...

FROM $(RepositorioQvd)DetallesWeek.qvd (qvd);

DatosDetail:

LOAD 'DW'&RowNo() as %LlaveWeekPrograma,

    [Tipo Venta],

...

FROM $(RepositorioQvd)DetallesWeek.qvd (qvd);

1 Solution

Accepted Solutions
Anil_Babu_Samineni

On what field bases you are generating keys' Because, 'Text' & RowNo() returns only one not for until rows available from table?

May be you can use AutoNumber() function

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

3 Replies
Anil_Babu_Samineni

On what field bases you are generating keys' Because, 'Text' & RowNo() returns only one not for until rows available from table?

May be you can use AutoNumber() function

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
cristian_av
Creator III
Creator III
Author

Hi Anil

I was not generating the keys based on a field, but instead I was trying to generate it based on the position on the table. But it is not working. With autonumber it works, but I wanted to know why it is not working based on position instead of fields.

Regards

Anil_Babu_Samineni

Because, 'DW' & RowNo() returns only one where AutoNumber() generate sequential. Read more from help

If you found solution, May be you can close this thread

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)