Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

How to combine 2 similar QV data structure into 1 ?

Hi All

I have 2 QV Doc one is for singapore , another one for indonesia. Both have similar data structure.

Both raw data file are identical. Due to below script , i am not able to contentenance both file :-

durationMap:

MAPPING LOAD

rowNo() as key,

(((recno()-1)*3)+1)  & '-' & (((recno()-1)*3)+3) & ' Mth' as label

AUTOGENERATE 20  //org 7

WHILE iterNo() <= 3

;

Can some one advise me how to append the 2 doc into 1 ?

Paul

1 Solution

Accepted Solutions
tresesco
MVP
MVP

I guess, somewhere the order of the script is not right or the table name reference is not being proper. try something like:

Mapping Load ............;

ApplyMap ..................;

DataTable:

Load ................ from source1;

Load ................ from source2;

View solution in original post

9 Replies
tresesco
MVP
MVP

if your Data tables are identical, you can simply concatenate the second one into the first one. your durationtable should not hamper.

like:

DurationMapTable:

Load ...............;

Data:

Load .......... from source1;

Load ...........from source1; // it will get concatenated with the Data table.

Kushal_Chawda

Hi,

I am not sure I have understood your problem correctly, but you can create a qvd from both the application by storing the data and then concatenate both the qvd

Store the required tables from both the application into the qvd, then do concatenate in other application.

paulyeo11
Master
Master
Author

Hi tres

your approach did work , but only if i run the below script :-

LOAD *,

          applyMap('durationMap', [No of Months_], '64 Mth and more') as Duration3

;

Now i narrow and found the above script cause the system hung up. any idea how to avoid ?

Paul

paulyeo11
Master
Master
Author

Hi Kush

Yes i think this is good suggestion. i will try later.

Paul

paulyeo11
Master
Master
Author

Hi Vish

My actual QV doc have load many data. so i am not able to use your approach , any way thank you for your sharing.

Paul

tresesco
MVP
MVP

this section of code should be preceded by Mapping Load section. hope you are not missing that.

paulyeo11
Master
Master
Author

Hi tres

You are right , once i remove  my both country inventory raw data file script below :-

Ceil(Num(if(num(((date(today(),'DD/MM/YYYY') - date(@168:179,'DD/MM/YYYY'))/365))=0,1,num(((date(today(),'DD/MM/YYYY') - date(@168:179,'DD/MM/YYYY'))/365)))*12)) as  [No of Months],

it work work fine.

Alternative if i only run one country raw data file , with above script turn on  it also work.

So how can i tell QV to combine both my raw data first ? any idea ?

tresesco
MVP
MVP

I guess, somewhere the order of the script is not right or the table name reference is not being proper. try something like:

Mapping Load ............;

ApplyMap ..................;

DataTable:

Load ................ from source1;

Load ................ from source2;

paulyeo11
Master
Master
Author

Hi tres

i just move applyMap to last line , and it work fine now, many thank for all your input in give me confident to try.

Mapping Load ............;

Load ................ from source1;

Load ................ from source2;

ApplyMap ..................;