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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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);

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

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
MVP
MVP

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!!