Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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

Labels (4)
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.