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

Work in to 1 Excel

Hello,

Actually I need to work on a excel. Something like that:

Excel:

YearInformation 1Information 2

2000

A1B1
2000A2B3
2000A4B2
2001A6B7
2002A8B9
2002A9B10

I would like to transform this excel into a QVD like that:

QVD:

YearInformation 1Information 2
2000A1B1
2000A2B3
2000A4B2
2001A6B7
2001A1B1
2001A2B3
2001A4

B2

2002A9B10
2002A6B7
2002A1B1
2002A2B3
2002A4B2
2002A8B9

"Information 1" and "Information 2" are random values.

Regards

12 Replies
villegasi03
Creator
Creator

This should work. Its roundabout way to do it but it works. Wouldn't try this if you are dealing with large datasets though.

TEMP_TABLE:
LOAD DISTINCT
YEAR
FROM

(
ooxml, embedded labels, table is Sheet1);

OUTER JOIN

LOAD DISTINCT
INFO1,
YEAR AS YEAR_TEMP
FROM

(
ooxml, embedded labels, table is Sheet1);


FINAL_TABLE:
LOAD DISTINCT
YEAR AS YEAR_FINAL,
INFO1 AS INFO1_FINAL
RESIDENT TEMP_TABLE
WHERE YEAR >= YEAR_TEMP;

LEFT JOIN

LOAD DISTINCT
INFO1 AS INFO1_FINAL,
INFO2 AS INFO2_FINAL
FROM

(
ooxml, embedded labels, table is Sheet1);

DROP TABLE TEMP_TABLE ;

Kushal_Chawda

try this,

Fact:

LOAD Year,

    concat( DISTINCT [Information 1]&'-'& [Information 2],',') as Info

FROM

[https://community.qlik.com/thread/186210?sr=stream]

(html, codepage is 1252, embedded labels, table is @1)

where len(trim(Year))>0

Group by Year;

New:

noconcatenate

LOAD Distinct *,

if(RowNo()=1,Info,

if(Year<>Previous(Year),Info &','& Peek('Info1'))) as Info1

Resident Fact

Order by Year ;

DROP Table Fact;

Final:

LOAD Distinct Year,

SubField(Info2,'-',1) as Information1,

SubField(Info2,'-',2) as Information2;

LOAD Year,

SubField(Info1,',') as Info2

Resident New;

DROP Table New;

Kushal_Chawda

are you able to resolve your issue?