Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to do what I think might be a simple thing, though I might be going at it wrong.
I have a piece of data (which happens to be a filename, but not too important)
it's in format:
Word-Thing-Idea-Number-Description-Iteration
What I want is to parse out the first 4 subfields and call that 'id', ending up with:
Word-Thing-Idea-Number only.
The lengths are different, so left() won't work.
subfield() seems to be producing strange results when I try different things.
Any way besides splitting it out individually and then re-concatenating it?
thanks in advance.
May be try this?
LOAD *, LEFT(data, Index(data, '-',4)-1) AS NewDatafield INLINE [
id, data
1, ab-cde-efgh-ij-k-lm
2, abc-de-fg-hij-klm
];
That means, You are going to get first 4 words from Field?
Hi Joey,
Subfield should work. Can you post or upload an example or your requirement in a qvw file?
Some examples for you How to Split the string into number of sub strings and how to extract date from filename
-Siva
First off, this is Qlik Sense, so qvw isn't an option.
Here's an example:
Data:
LOAD * INLINE [
id, data
1, ab-cde-efgh-ij-k-lm
2, abc-de-fg-hij-klm
];
NewData:
Load
id,
subfield(data, {fields1-4??}) as newdatafield
Resident Data;
Ideal end result:
id, newdatafield
1 ab-cde-efgh-ij
2 abc-de-fg-hij
Thanks
May be try this?
LOAD *, LEFT(data, Index(data, '-',4)-1) AS NewDatafield INLINE [
id, data
1, ab-cde-efgh-ij-k-lm
2, abc-de-fg-hij-klm
];