Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Sxbbb
Creator III
Creator III

want to add - to count the 6th data from the left.

want to add '-' to count the 6th data from the left.
 

I have a field 'Lot '

in field  'Lot ' contains data :

Sxbbb_0-1679724776002.png

 

 

want to add '-' to count the 6th data from the left.

EX

165052-171

172050-012

7 Replies
rubenmarin

Hi, you can load the field lot as:

Left(lot,6)&'-'&Mid(lot,7) as lot

If you don't want the dash for lots with less than 7 caharacters you can inlude the condition in an if:

If(len(lot)>6, Left(lot,6)&'-'&Mid(lot,7), lot) as lot

Sxbbb
Creator III
Creator III
Author

I use this code value came out correct : Left(lot,6)&'-'&Mid(lot,7) as lot 

and I want to put 'A0' as the first two in this field 

 

I tried this code but the values ​​are not showing : 

Left(Lot,6)&'-'&Mid(Lot,7) and 'A0'&''& Lot as LotNew

EX 

A0165052-171

A0172050-012

 

rubenmarin

Hi, try with:

'A0' & Left(lot,6)&'-'&Mid(lot,7) as lot

Sxbbb
Creator III
Creator III
Author

I have used this code value came out correct

and i want to cut out the 11th

EX 

A0165052-17

A0172050-01

rubenmarin

'A0' & Left(lot,6)&'-'&Mid(lot,7,2) as lot

Sxbbb
Creator III
Creator III
Author

I have used this code value came out correct.

and I want to add -000 to the end.

EX 

A0165052-17-000

A0172050-01-000

rubenmarin

If we added A0 as 'A0' & I think you can easily deduct hoy to add a fixed '-000' at the end.

And if not please ask all the modifications you need in one question.