Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Congratulations to the new Qlik Luminary and Partner Ambassador class! Meet them here
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

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

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

tresB
Champion III
Champion III

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
MVP
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