Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

eduardo_dimperi
Valued Contributor II

Continue counting from last position

Hi people,

I have this :

INPUT

    

TABLE 1
FIELD_IDVALUEROW
10ABCD1
12DFHD2
13FFSF3
14HHJK4

   

TABLE 2
FIELD_IDVALUE
5FFVM
11XXSW

OUTPUT

    

TABLE 2
FIELD_IDVALUEROW
5FFVM5
10ABCD1
11XXSW6
12DFHD2
13FFSF3
14HHJK4

So i need to continue counting from last position before concatenate Table 2 in Table 1, that some way to set RowNo() to start from a position?

1 Solution

Accepted Solutions

Re: Continue counting from last position

Inline load is for sample only.

T1:
Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE From YourTable1;

T2:
Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE From YourTable2;


8 Replies

Re: Continue counting from last position

T1:

Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE Inline

[

FIELD_ID, VALUE, ROW

10, ABCD, 1

12, DFHD, 2

13, FFSF, 3

14, HHJK, 4

];


T2:

Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE Inline

[

FIELD_ID, VALUE, ROW

5, FFVM

11, XXSW

];

eduardo_dimperi
Valued Contributor II

Re: Continue counting from last position

If i have 100000 lines, i will need to  create a Inline with each line?

I need to create a kind of primary key.

Re: Continue counting from last position

Inline load is for sample only.

T1:
Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE From YourTable1;

T2:
Load AutoNumber(RowNo()) as ROW, FIELD_ID,VALUE From YourTable2;


sasiparupudi1
Honored Contributor III

Re: Continue counting from last position

May be like this?

T1: 

Load  ROW, FIELD_ID,VALUE Inline 

FIELD_ID, VALUE, ROW 

10, ABCD, 1 

12, DFHD, 2 

13, FFSF, 3 

14, HHJK, 4 

]; 

Let x=FieldValue('ROW',FieldValueCount('ROW'));

set x=1; 

T2: 

Load  if(RowNo()=1,$(x),Peek(ROW)+1) As ROW, FIELD_ID,VALUE Inline 

FIELD_ID, VALUE, ROW 

5, FFVM 

11, XXSW 

];

sasiparupudi1
Honored Contributor III

Re: Continue counting from last position

Hi Have you managed to find a correct solution to your question?

eduardo_dimperi
Valued Contributor II

Re: Continue counting from last position

Hi Sasidhar, sorry, but my boss ask me a SLA here so i could find time to test today. I'll focus on that issue only tomorrow.

eduardo_dimperi
Valued Contributor II

Re: Continue counting from last position

Hi Manish,

Using AutoNumber(FIELD_ID&VALUE) to generate a Primary Key with table 1, if i use AutoNumber(FIELD_ID&VALUE) to a table 2, thats a chance that Key occur more than 1 time? I can't have reapeat number keys.


Thank You

eduardo_dimperi
Valued Contributor II

Re: Continue counting from last position

I made some tests and exists a chance to repeat a key if i run the tables in separated moments, like save a qvd and after run a table, but if i do an incremental load will be fine. Thank you.

Community Browser