Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
MathiasVSteerteghem
Contributor II
Contributor II

Split data from 2 tables instead of combining them

Recently I started with Qlik Sense for my student job at Umicore. They asked me to make an app to quickly see the data from last month from several measurements. Now everything works fine but I would like to combine this all in one app.

The problem is that I have 4 files where we have data from 4 inspected things. So the column names are the same and the layout is the same but the data is different. When I load 4 files, it always takes the data from the 4 files. So I can't make a chart with the data of 1 inspected thing. 

Is there a way to make a distinction while loading the files? Or should I better keep separate apps for each inspected device?

Thanks in advance for the answers!

Labels (1)
5 Replies
Lisa_P
Employee
Employee

One way of identifying where the data came from is to add an additional field that is hardcoded based on the data source. You can then use that as a filter when creating your visualizations.

Not sure what your data looks like, but as an example ..

Load

Field1,

Field2,

..

'Source1' as Type

from ....;

etc

MathiasVSteerteghem
Contributor II
Contributor II
Author

Hmm oke so I added the type and the data load works just fine. But how could I use this as filter in for example a sum function?

Lisa_P
Employee
Employee

Using Set Analysis you can define the 'set' of data you want to look at in a chart.

eg sum(Sales) is not filtered unless you select, but sum({<Type={Source1}>}Sales)

MathiasVSteerteghem
Contributor II
Contributor II
Author

Hmm It looks like the data still loads the same way. I added the source conditions and tried to fill these into the sum expression from my chart. It seems that the function doesn't recognise the 'source1' value. Here is my data load script, maybe you see something that is wrong.

For each vFileName in Filelist ('lib://Branders/Branders_*.xls*')
Branders:
LOAD
Dienst,
"Totaal in gebruik",
"Keuringen over tijd",
"Keuringen binnen termijn",
Source1 as Type,
Date#(SubField(SubField(SubField('$(vFileName)','/',-1),'.',1),'_',2),'YYYYMMDD') as Maand
FROM [$(vFileName)] (ooxml, embedded labels, table is Branders) ;
Next vFileName

For each vFileName in Filelist ('lib://Haspels/Haspels_*.xls*')
Haspels:
LOAD
Dienst,
"Totaal in gebruik",
"Keuringen over tijd",
"Keuringen binnen termijn",
Source2 as Type,
Date#(SubField(SubField(SubField('$(vFileName)','/',-1),'.',1),'_',2),'YYYYMMDD') as Maand
FROM [$(vFileName)] (ooxml, embedded labels, table is Haspels) ;
Next vFileName

Lisa_P
Employee
Employee

In your case

'Branders' as Type

or 

'Haspels' as Type