Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
phb_nostromo
Contributor III
Contributor III

How to sort a table in another order than load order

Hello,

Please excuse for my english and the newbie aspect to QlikView in the question i have to submit ...

It seems simple, and easy under excel.. but i need to know how could i get the value of the column LineNumber for the first value of Pandora_key. That's done in order to remove duplicates from a far bigger table.

  

Pandora_keyLineNumber
11
22
33
44
45
66
77
78
89
910
911
912
913
914
915
916
917
918
919
920
921
1022
1023

So here for instance, i'd like to have LineNumber = 1 for Pandora_key = 1, 10 for 9, 22 for 10.

The code is :

[TableBrute]:

LOAD distinct

     Pandora_key,

     recno() as LineNumber

FROM

(qvd);

Table:

load Pandora_key, LineNumber resident  TableBrute

where previous(Pandora_key) <> Pandora_key

order by Pandora_key, ;

Could anybody help me Please ??

Thanks a million . I'm getting stuck here

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Script:

Table:

LOAD Pandora_key,

  RecNo() as TempLineNumber

FROM

[https://community.qlik.com/thread/210457]

(html, codepage is 1252, embedded labels, table is @1);

Join(Table)

LOAD Pandora_key,

  Min(TempLineNumber) as LineNumber

Resident Table

Group By Pandora_key;

View solution in original post

3 Replies
sunny_talwar

This?

Capture.PNG

Script:

Table:

LOAD Pandora_key,

  RecNo() as TempLineNumber

FROM

[https://community.qlik.com/thread/210457]

(html, codepage is 1252, embedded labels, table is @1);

Join(Table)

LOAD Pandora_key,

  Min(TempLineNumber) as LineNumber

Resident Table

Group By Pandora_key;

phb_nostromo
Contributor III
Contributor III
Author

Thanks a lot Sunny !  You brought sunlight on my trouble !

Digvijay_Singh

t1:

Load * inline [

Pandora_key LineNumber

1 1

2 2

3 3

4 4

4 5

6 6

7 7

7 8

8 9

9 10

9 11

9 12

9 13

9 14

9 15

9 16

9 17

9 18

9 19

9 20

9 21

10 22

10 23 ](delimiter is spaces);

NoConcatenate

Table:

load Pandora_key,

  min(LineNumber) as LineNumber

Resident  t1

Group By Pandora_key;

Drop table t1;