Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Splitting a field

Hi Experts,

I have a dimension field which has Alphanumeric data

like 79342-John Albert (i have a hyphen in between)

i need to separate into two. one with numeric data and other with the Alphabets

like Field1 - 79342

      Field2 - John Albert

Is it possible to split?

How can i do this. pls help

1 Solution

Accepted Solutions
tresesco
MVP
MVP

SubField('79342-John Albert','-',1)

SubField('79342-John Albert','-',2)

And this can be used in pivot table(or anywhere at the front-end)

You can use field name instead of the string.

View solution in original post

6 Replies
arulsettu
Master III
Master III

try like this

SubField('79342-John Albert',2) as numericfield,

SubField('79342-John Albert','-',2) as textfield

Not applicable
Author

i need to do this on pivot table and not on script.

pls help

tresesco
MVP
MVP

SubField('79342-John Albert','-',1)

SubField('79342-John Albert','-',2)

And this can be used in pivot table(or anywhere at the front-end)

You can use field name instead of the string.

Not applicable
Author

Hi,

thanks for the response

the example is the field value not the field name

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Yes its possible.

You can use the subfield function to get the separate fields.

Load Old_Field_Name,

SubField(Old Field Name,'-',1)  as Field1,

SubField(Old Field Name,'-',1)  as Field2

From XYZ;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
alex_millan
Creator III
Creator III

Hi,

create two calculated dimensions on your pivot table:

SubField('79342-John Albert','-',1)

SubField('79342-John Albert','-',2)

HTH

Regards