Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AmCh
Creator
Creator

Split a table

Hello all,

I have the following table (xls.) as an input:

SystemVariant
A11
A12
A13
B21
B22
B23
C31
C32
C33

 

I want to import those fields separetly and named:

Fields:

A_Variants
11
12
13

 

B_Variants
21
22
23

 

C_Variants
31
32
33

 

Any help please?

 

Thanks in advance.

1 Solution

Accepted Solutions
Taoufiq_Zarra

@AmCh 

Maye be like this:

Data:
LOAD * INLINE [
    System, Variant
    A, 11
    A, 12
    A, 13
    B, 21
    B, 22
    B, 23
    C, 31
    C, 32
    C, 33
];

Tmp:
load distinct System as SysTmp resident Data;


FOR Each a in FieldValueList('SysTmp')

LOAD Variant as '$(a)_Variant' resident Data where System='$(a)';

NEXT a 

drop table Data,Tmp;

output:

Taoufiq_Zarra_0-1620137399643.png

Taoufiq_Zarra_1-1620137432503.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

1 Reply
Taoufiq_Zarra

@AmCh 

Maye be like this:

Data:
LOAD * INLINE [
    System, Variant
    A, 11
    A, 12
    A, 13
    B, 21
    B, 22
    B, 23
    C, 31
    C, 32
    C, 33
];

Tmp:
load distinct System as SysTmp resident Data;


FOR Each a in FieldValueList('SysTmp')

LOAD Variant as '$(a)_Variant' resident Data where System='$(a)';

NEXT a 

drop table Data,Tmp;

output:

Taoufiq_Zarra_0-1620137399643.png

Taoufiq_Zarra_1-1620137432503.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉