Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
eduardo_dimperio
Specialist II
Specialist 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
MK_QSL
MVP
MVP

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;


View solution in original post

8 Replies
MK_QSL
MVP
MVP

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_dimperio
Specialist II
Specialist II
Author

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

I need to create a kind of primary key.

MK_QSL
MVP
MVP

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
Master III
Master III

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
Master III
Master III

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

eduardo_dimperio
Specialist II
Specialist II
Author

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_dimperio
Specialist II
Specialist II
Author

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_dimperio
Specialist II
Specialist II
Author

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.