Re: How to map values with squarebrackets into values without squarebrackets
Check this file not using MapSubString (I don't think you need it here). Just make sure you want to remove everything after the brackets:
Left('2222', Index('2222', '[') -1)
So the script will look like the following
LOAD Left(Field1, Index(Field1, '[') -1) AS Field1
(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);
On the other hand, two considerations:
When you load INLINE, the start and end of data is marked by square brackets, so you cannot use them as values, and that's why you are getting that "Garbage after statement", because QlikView reads the next "]" and understands that the INLINE load finishes there, that is not correct.
When you want to mark a line of script as comment, use // instead of ''