Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

Excel Data transformation

Hi All,

I want to load the excel source data.

Note: I have many columns are there in the excel file with different Group text values.

Source Data Format:

A.PNG

Required Out put Format:

B.PNG

1 Solution

Accepted Solutions
bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

You could looking into a For Each Loop for this and maybe map the GroupName in or else do something simpler like this.

Here is how I tried to solve it in the script:

Data:


LOAD Country,

     Cust,

     Category,

     DimA,

     ProdA,

     'Group1' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Concatenate (Data)


LOAD Country,

     Cust,

     Category,

     Status,

     Value,

     'Group2' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Concatenate (Data)


LOAD Country,

     Cust,

     Category,

     Sales,

     Desc,

     'Group3' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Capture.PNG

I can see that the DimA and ProdA didn't turn out exactly the same...I am trying to understandwhy Group 1 is for these two columns, but still the data in these two columns are categorized by all groups?


Best,


Ali A

View solution in original post

5 Replies
olivierrobin
Specialist III
Specialist III

hello

you can use file assistant

and you will obtain something like that

LOAD Country,

     Cust,

     Category,

     DimA,

     ProdA,

     Status,

     Value,

     Sales,

     Desc

FROM

[Data_Loading - Copy.xlsx]

(ooxml, embedded labels, header is 1 lines, table is DummyData);

Neymar_Jr
Creator II
Creator II

Hi

See if this helps - multi_header_pivot_import.qvw

Thanks,

RT

bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

You could looking into a For Each Loop for this and maybe map the GroupName in or else do something simpler like this.

Here is how I tried to solve it in the script:

Data:


LOAD Country,

     Cust,

     Category,

     DimA,

     ProdA,

     'Group1' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Concatenate (Data)


LOAD Country,

     Cust,

     Category,

     Status,

     Value,

     'Group2' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Concatenate (Data)


LOAD Country,

     Cust,

     Category,

     Sales,

     Desc,

     'Group3' AS GroupName

FROM

(ooxml, embedded labels, header is 1 lines, table is DummyData);


Capture.PNG

I can see that the DimA and ProdA didn't turn out exactly the same...I am trying to understandwhy Group 1 is for these two columns, but still the data in these two columns are categorized by all groups?


Best,


Ali A

Gysbert_Wassenaar

Perhaps like this:

Data:

LOAD

     Country,

     Cust,

     Category,

     DimA,

     ProdA,

     'Group1' as GroupName

FROM

     ...excel file...

CONCATENATE (Data)

LOAD

     Country,

     Cust,

     Category,

     DimA,

     ProdA,

     Status,

     Value,

     'Group2' as GroupName

FROM

     ...excel file...

CONCATENATE (Data)

LOAD

     Country,

     Cust,

     Category,

     DimA,

     ProdA,

     Sales,

     Desc,

     'Group3' as GroupName

FROM

     ...excel file...


talk is cheap, supply exceeds demand
arvind1494
Specialist
Specialist

Hi Areths,

I did this for you.

please download this qvw and check the solution.