Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

split Field into FeildValues in Script

hi,

Is there any possibility to split the Field in script into Field values to rename them Ie., I am loading the data from excel sheet where Feild

is identifier consists like below attachment.But i want to rename them as A for 1st record, B for 2nd and so on how to do.

I have read some post on this subject without to find a solution understandable for me.

thanks in advance.

14 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Field names refer to columns, whereas record numbers refer to rows, so I am confused as to what you are asking. I suggest that you post an example qvw and/or some source data and your desired results.

EDIT please don't upload these as image files.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
trdandamudi
Master II
Master II

Can you please give more details with source and expected output....

DavidFoster1
Specialist
Specialist

Subfield function based on the point character would allow you to divide up this field, but you would still need to have a subfield for each one you want to split out.

Not applicable
Author

hi,

record  refer to rows ie., i have field Identifier which is having 5 records  which i has to rename like 2.16.840.1.114416.1.24.132565 as A and so on is it possible

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Try using String functions:

Data:

LOAD Identifier

  ,SubField(Identifier, '.', 1) as SubField1

  ,SubField(Identifier, '.', 2) as SubField2

  ,SubField(Identifier, '.', 3) as SubField3

  ,SubField(Identifier, '.', 4) as SubField4

  ,SubField(Identifier, '.', 5) as SubField5

  ,SubField(Identifier, '.', 6) as SubField6

  ,SubField(Identifier, '.', 7) as SubField7

  ,SubField(Identifier, '.', 😎 as SubField8

  ,Left(Identifier, 17) as Left

  ,Right(Identifier, Len(Identifier) - 18) as Right

  ,Mid(Identifier, 6, 12) as Mid

FROM

(ooxml, embedded labels, table is Sheet1);

The results:

Screenshot_1.jpg

Not applicable
Author

hi,

thanks for the response. but what i want is that single record should be renamed as A,B respectively. 

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Could you please give an example?

Let's assume you have a table from one field that contains 6 records:

Identifier
2.16.840.1.114416.1.24.132565
2.16.840.1.114416.1.24.132574
2.16.840.1.114416.1.24.132586
2.16.840.1.114416.1.24.132590
2.16.840.1.114416.1.24.1382597
2.16.840.1.114416.1.24.1382622

What results do you expect?

DavidFoster1
Specialist
Specialist

This sounds like a simple apply map on a concatenated/compound key value.

MAP_8PartKey:

LOAD * INLINE [

8PartKey, Name

2.16.840.1.114416.1.24.132565, A

];

and then in your table load you can reference

ApplyMap('MAP_8PartKey',[key field])     as FieldName

Not applicable
Author

this is what i am expecting

Identifier

2.16.840.1.114416.1.24.132565      A

2.16.840.1.114416.1.24.132574      B

or

Identifier

meter A

meter B