Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Not applicable

Re: Concatenate Keys

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
Highlighted

Re: Concatenate Keys

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

Highlighted
Not applicable

Re: Concatenate Keys

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