Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlikview-Community,
i am looking for a solution to the following problem:
Ich have a text field = Name in a table with up to 80 chars long.
I want to seperate it into two textfields Name1 and Name2, but without sperating words.
Example:
Namefield=This is a text which is much much much longer than 40 chars, but not longer than 80
LEFT(Namefield,40) AS Namefield1 = This is a text which is much much much l
RIGHT(Namefield,40) AS Namefield2 = onger than 40 chars, but not longer than 80
Is there a away to avoid seperating single words dynamically?
Try this
Table:
LOAD *,
Index(Left(Namefield, 40), ' ', -1) as SpacePos,
Left(Namefield, Index(Left(Namefield, 40), ' ', -1)) as Namefield1,
Right(Namefield, Len(Namefield) - Index(Left(Namefield, 40), ' ', -1)) as Namefield2;
LOAD * INLINE [
Namefield
"This is a text which is much much much longer than 40 chars, but not longer than 80"
"This is a text which is much much longer than 40 chars, but not longer than 80"
"This is a text which is much longer than 40 chars, but not longer than 80"
];
In this case, where would you want the longer to show up? First Half or Second half and why?? or does it not matter?
The length of Namefield1 should not exceed 40 chars, so the longer should go completly to Namefield2
Try this
Table:
LOAD *,
Index(Left(Namefield, 40), ' ', -1) as SpacePos,
Left(Namefield, Index(Left(Namefield, 40), ' ', -1)) as Namefield1,
Right(Namefield, Len(Namefield) - Index(Left(Namefield, 40), ' ', -1)) as Namefield2;
LOAD * INLINE [
Namefield
"This is a text which is much much much longer than 40 chars, but not longer than 80"
"This is a text which is much much longer than 40 chars, but not longer than 80"
"This is a text which is much longer than 40 chars, but not longer than 80"
];
Thank you very much Sunny_talwar,
i just tired it out and it works like a charm!
Best wishes,
Hermann