Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
davekski
Contributor
Contributor

Remove Last 3 characters in load script

I have a field "Related Id" that I need to remove the last 3 characters from all the values. My load script currently looks like this. I have tried several variations of trim but nothing seems to work:

LOAD
"Related Id",
Status,
"Comment",
left("Related Id",len(trim("Related Id"))-3)


FROM [lib://TrackWise Reports/Workflow History Cancelled 9-5-2019.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

1 Solution

Accepted Solutions
sunny_talwar

May be this

LOAD "Related Id",
     "Status",
     "Comment",
     Left(Trim("Related Id"), Len(Trim("Related Id"))-3) as NewField
FROM [lib://TrackWise Reports/Workflow History Cancelled 9-5-2019.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

 

View solution in original post

2 Replies
sunny_talwar

May be this

LOAD "Related Id",
     "Status",
     "Comment",
     Left(Trim("Related Id"), Len(Trim("Related Id"))-3) as NewField
FROM [lib://TrackWise Reports/Workflow History Cancelled 9-5-2019.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

 

davekski
Contributor
Contributor
Author

That worked, thank you!!