Skip to main content
Announcements
The New Qlik Learning Experience is Here! GET STARTED
cancel
Showing results for 
Search instead for 
Did you mean: 
pamaxeed
Partner - Creator III
Partner - Creator III

Split Field in Field Name and Values

Hi guys,

is there a way to split the following Dimension Value:

Dim1:a;Dim2:x;

in the following output that i can have my table in qlikview like that:

Dim1
Dim2
ax

Do I need to use Generic Load Prefix?

Thanks,

Patric

1 Solution

Accepted Solutions
sunny_talwar

May be this:

TableInput:

LOAD SubField(SubField(SubField(Field1, ';', 1), ':', 2), ',') as DIM1,

  SubField(SubField(SubField(Field1, ';', 2), ':', 2), ',') as DIM2;

LOAD * Inline [

Field1

Dim1:1,2;Dim2:1

] (delimiter is |);

Output

Capture.PNG

View solution in original post

14 Replies
sunny_talwar

Generic prefix is one option. Or you can alos do this:

Table1:

LOAD Dim1

FROM yourTable;

Table2:

LOAD Dim2

FROM yourTable;

pamaxeed
Partner - Creator III
Partner - Creator III
Author

Is that working?

For instance my field could be also like that:

Field1: Dim1:1,2;Dim2:1;

So we have more values for Dim1 for instance and it should be translated in the right table output like above:

FIELD1                                   DIM1                                     DIM2

Dim1:1,2;Dim2:1;                   1                                             1

Dim1:1,2;Dim2:1;                   2                                             1

sunny_talwar

It should. Are you looking to do this in the script or front end of the application?

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi Patric,

You can use this:

For Dim1:

=Left('Dim1:a;Dim2:x;', 4)

For Dim2:

=Mid('Dim1:a;Dim2:x;', 8, 4)

For expression to get "a" field:

=Mid('Dim1:a;Dim2:x;', 6, 1)

For expression to get "x" field:

=Mid('Dim1:a;Dim2:x;', 13, 1)

Regards,

MB

pamaxeed
Partner - Creator III
Partner - Creator III
Author

In the script my Input is like that:

TableInput:

Field1

Dim1:a;Dim2:x;;

Input:

Load Field1

From Dummy;

Output:

Load .......

Drop table Input;

where the output table looks like this:

FIELD1                                   DIM1                                     DIM2

Dim1:1,2;Dim2:1;                   1                                             1

Dim1:1,2;Dim2:1;                   2                                             1

Cheers,

Patric

pamaxeed
Partner - Creator III
Partner - Creator III
Author

The problem is that the proposed solution is not flexible:

I have to have a generic solution, this means that my input key field can look also like that:

Field1

Asterix:1,2,3;Position:a,b,x;

Patric

miguelbraga
Partner - Specialist III
Partner - Specialist III

Like this:

pamaxeed
Partner - Creator III
Partner - Creator III
Author

Sry that is not working for me.

I have to have a generic solution.

miguelbraga
Partner - Specialist III
Partner - Specialist III

I'll take a look if there is a way to solve your problem