Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Upali_Wijearatne
Contributor III
Contributor III

To Combimed two Files

Hi Experts

In my Qv file I have loaded two tables (Table1 and Table1) as per Sc attached Below. In my 3rd Table I want to insert two columns(Purchase & Sale) and create a new table. In my new  table (table 3) I want get 1st and 4th  column from table 1. I want to sum data in table 2 (month wise) and inset into table 3 as 2nd and 3rd Column(Purchase & Sales). I am unable figure out how to do it. Kindly help me with the load script to do this

Upali_Wijearatne_0-1709451744095.png

 

Labels (1)
5 Replies
anat
Master
Master

T:

load Date,BF,CF from table;

T1:

load Date,purchase,sales from table;

noconcatenate

left join(T)

T2:load monthend(Date) as Date,sum(purchase) as purchase,sum(sales) as sales resident T1:

drop table T1:

 

Upali_Wijearatne
Contributor III
Contributor III
Author

Thanks

I get the below error when I try load data

Upali_Wijearatne_0-1709454996064.png

 

my script is shown below please. 

Upali_Wijearatne_1-1709455110391.png

Kindly advise me

anat
Master
Master

remove "Noconcatenate" from the script

T:
load * Inline [
Date,BF,CF
1-1-2022,1,1

];
T1:
load * Inline [
Date,p,s
1-1-2022,2,3
1-2-2023,2,2
];

Left Join(T)
T2:
LOAD MonthEnd(Date) as Date,sum(p) as p,sum(s) as s Resident T1 Group by Date;
DROP Table T1;

Upali_Wijearatne
Contributor III
Contributor III
Author

I tried with you sample code it does not return P & S Values please

Upali_Wijearatne_0-1709460414424.png

 

anat
Master
Master

May be check date format

T:

Load date(Date) as Date, BF, CF;
load * Inline [
Date,BF,CF
1-1-2022,1,1

];
T1:
load * Inline [
Date,p,s
1-1-2022,2,3
1-2-2023,2,2
];

Left Join(T)
T2:
LOAD date(MonthEnd(Date)) as Date,sum(p) as p,sum(s) as s Resident T1 Group by Date;
DROP Table T1;