Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Order Table

Hello everyone! i have an issue to create one table like that :

Field 1Field 2
AB
BC
CD
D

I want to create a table, like the forward example, in the Script Editor.

From field A, I want to create a field B equal to that shown in the figure. In field A I have the order "A - B - C - D" and I want to create a field B associated to field A with the Association "B - C - D" where A = B and B = C and C = D.


Help me please.

1 Solution

Accepted Solutions
eespiritu
Creator
Creator

Hi,

Try to use this code:

TMP_TABLE:

LOAD * INLINE [

    ID,FIELD1

    1, A

    2, B

    3, C

    4, D

];

NoConcatenate

Final:

Load

  ID,

  FIELD1,

  Peek('FIELD1') as FIELD2

Resident TMP_TABLE

order by ID desc;

Drop table TMP_TABLE;

Regards,

Enrique

View solution in original post

5 Replies
eespiritu
Creator
Creator

Hi,

Try to use this code:

TMP_TABLE:

LOAD * INLINE [

    ID,FIELD1

    1, A

    2, B

    3, C

    4, D

];

NoConcatenate

Final:

Load

  ID,

  FIELD1,

  Peek('FIELD1') as FIELD2

Resident TMP_TABLE

order by ID desc;

Drop table TMP_TABLE;

Regards,

Enrique

Not applicable
Author

Yhank you ! it work with numbers, but dont work with dates... do you know why ?! thanks

eespiritu
Creator
Creator

No problem.

Do you have the example?, what are you trying to do with the dates?

Not applicable
Author

the same think! but when i put dates in the field, the dates dont show... probably is an formating issue...

Anonymous
Not applicable
Author

Try formatting your dates as numbers in your script  num(DateField)