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: 
thotapallavi
Contributor
Contributor

I have an app which should retrieve data from single data source of multiple files

Hi all,

I have created an app using Qlik view and loaded two csv files into the data source. In the app i have created a pivot table which displays values of year as dimension and measures as sum(Quantity_Sold), Avg(Quantity_Sold). Similar fields loaded in different file but data is different.

Now, when i try to display data from first file then it displays as is. But my question is how to display second file data when it has similar field names Year as dimension and measures as sum(Quantity_Sold), Avg(Quantity_Sold).

Am able to see both the files in the data load editor but not able to display data from two different files.

Thanks in advance.

2 Replies
sunny_talwar

I would add flags from the two sources while loading the data. Something along these lines:

Table1:

LOAD Year,

          Quantity_Sold,

          1 as Flag

From Source1;

Concatenate (Table1)

LOAD Year,

          Quantity_Sold,

          2 as Flag

FROM Source2;

Now when you want to use both datasources use this expressions -> Sum(Quantity_Sold).

On the other hand if you just want to use source 1 -> Sum({<Flag = {1}>} Quantity_Sold)

source 2 -> Sum({<Flag = {2}>} Quantity_Sold)

Gysbert_Wassenaar

If the source files have exactly the same fields then you'll end up in one table. You can add a field that stores from which source file the data came:

Data:

LOAD

     *,

     FileName() as Source,

FROM

     *.csv (txt, ...etc)

     ;


talk is cheap, supply exceeds demand