Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

loading data

Hi All,

I have a excel with headers of data , text file with all the data without headers ,how can i load this data into qlikview .any ideas ?

gwassenaarswuehlkush141087maxgrorwunderlichmrkachhiaimpstalwar1sorrakis01

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

PFA a possible solution

View solution in original post

8 Replies
Clever_Anjos
Employee
Employee

Would you mind sharing sample of your files?

Anonymous
Not applicable
Author

please find the attached files of header and transaction data

swuehl
MVP
MVP

Load your text file with option 'none' for labels, this will create a load like

Table:

LOAD @1,

     @2,

     @3,

     @4,

     @5,

     @6,

     @7,

     @8,

     @9,

     @10,

     @11

FROM

(txt, utf8, no labels, delimiter is ',', msq);

Do the similar for the header file, using an additional RecNo() as ID and a CROSSTABLE LOAD prefix, something like

CROSS:
CROSSTABLE (Header, FieldName)

LOAD Recno() as ID,

     @1,

     @2,

     @3,

     @4,

     @5,

     @6,

     @7,

     @8,

     @9,

     @10,

     @11

FROM

(txt, utf8, no labels, delimiter is ',', msq)

;

Then create a MAP:

MAP:

MAPPING

LOAD Header, FieldName

RESIDENT CROSS;

And then rename your original fields:

RENAME FIELDS USING MAP;

Anonymous
Not applicable
Author

this might be very dumb ,but can i ask you for an QVW with the sample data i attached

Clever_Anjos
Employee
Employee

Please check if fits your needs:

header:

LOAD *

FROM

[Header.xlsx]

(ooxml, embedded labels, table is Sheet1);

set str='';

For i = 1 to NoOfFields('header')

  let str = str & ',@' & i & ' as ' & FieldName(i,'header');

next

let str=mid(str,2);

LOAD $(str)

FROM

[transdata.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq);

Clever_Anjos
Employee
Employee

PFA a possible solution

Anonymous
Not applicable
Author

u made my life easy   thanks

i will keep you asking more questions in future

Kushal_Chawda

try this as well

Map_Field:
Mapping LOAD '@'&RecNo() as FieldFrom,
             
@1 as FieldTo   
FROM

(
ooxml, no labels, table is Sheet1, filters(
Transpose()
));


Data:
LOAD @1,
@2,
@3,
@4,
@5,
@6,
@7,
@8,
@9,
@10,
@11,
@12,
@13,
@14,
@15,
@16,
@17,
@18,
@19,
@20,
@21,
@22,
@23,
@24,
@25,
@26,
@27,
@28,
@29,
@30,
@31,
@32
FROM

(
txt, codepage is 1252, no labels, delimiter is '\t', msq);


RENAME Fields using Map_Field;