Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

TextObject

Hi All,

  I have one field name MyField which contains a value like:


 

MyField


 

 

AB-10,  ABC9-AB-12, BCDE-15,ZEAB-031-71


 

 

Now I want to show this value in Text Object only with
following formatting:

Part1     -              Part2

  AB          -              10

  ABC9     -              12

  BCDE     -              15

  ZEAB      -              71

Please help to find this.

Thanks.

14 Replies
crusader_
Partner - Specialist
Partner - Specialist

Hi,

So modify it a little bit

Data:

Load * Inline [MyField

'AB-10,  ABC9-AB-12, BCDE-15,ZEAB-031-71'

];

LOAD Concat(_NewField,chr(13)) as NewField;

Load SubField(Lines,'-',1) & '-' & SubField(Lines,'-',SubStringCount(Lines,'-')+1) As _NewField;

Load

Trim(SubField(MyField,',')) As Lines

resident Data;

sunny_talwar

Notice the quotation marks around the original string in the inline load in my example that are missing  in your file

I am not sure what you mean Piet‌? Is this for me?

Clever_Anjos
Employee
Employee

Please add quotes

Tab1:

Load * Inline [

Myfield

"AB-10,ABC9-AB-12,BCDE-15,ZEAB-031-71" ];

Tmp:

join LOAD

subfield(Myfield,',') as MyFieldSplitted

RESIDENT Tab1;

Clever_Anjos
Employee
Employee

Capturar.PNG

stigchel
Partner - Master
Partner - Master

No it was not Sunny, in the the sample that was attached by Soha1902  these were not in the inline load