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

Concatenate Keys

hi i have an issue with concatenation of ordernummer and order row key.

Ordernr
RowNr
% Key
100101100101
100101100101

i wish to set the length of the Order and the RowNr to 8 respective 5 places.

set  len Ordernr = 8;

set len Rownr = 5;

then i wish to do an if statement to check the amount of the characters in the string and where there are missing places replaces with 0

ie. if(len(Ordernr < 8, fill replace(Ordernr,' ', 0) as Ordernr_tmp

and the same for RowNr if required.

i have attached a sample app if anyone has dealt with this before?

Best

Brad

1 Solution

Accepted Solutions
Not applicable
Author

Hi Bradley

an other way is to concatenate like this, and autonumber your key

autonumber(OrderNr & '-' & Rownr)  

you'll get  100-101  transformed as number %Key = 1

and 1001-01 transformed as number %Key = 2

best regards

Chris

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hi Brad,

The easy way it comes to my mind is doing like this in the script:

LOAD

Text(Num(Ordernr, '00000000')) AS Ordernr // this will add leading zeroes as needed up to 8 figures total

Miguel

Not applicable
Author

Hi Bradley

an other way is to concatenate like this, and autonumber your key

autonumber(OrderNr & '-' & Rownr)  

you'll get  100-101  transformed as number %Key = 1

and 1001-01 transformed as number %Key = 2

best regards

Chris