Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
cristian_av
Contributor 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);

Tags (1)
1 Solution

Accepted Solutions

Re: IDs not matching with Rowno()

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

Re: IDs not matching with Rowno()

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

cristian_av
Contributor III

Re: IDs not matching with Rowno()

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

Re: IDs not matching with Rowno()

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)