Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Become an analytics expert with Qlik's new 15 week course: Applied Data Analytics using Qlik Sense. READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Howto: select what table to use data from in chart

Is there a way I can filter so data is only used from specified tables ?

Example:

[DataSet1]:

LOAD .......

[DataSet2]:

LOAD .......

Similar as I do below - to filter on a field values in my expression - I would like chart to only pull data from "DataSet1"

Count({<TASK = {'Drive'}, Priority = {'Important'}>} Priority)

8 Replies
simondachstr
Luminary Alumni
Luminary Alumni

This is an interesting question and requires more information from your side.

Your tables should have by default distinct column names (or else synthetic keys would have been created). Are you possibly trying to aggregate on a key field?

Or are you loading multiple DataSets of the same type (which get autoconcatenated in QS)?

NareshGuntur
Partner
Partner

To start where Martin ended,

if you have datasets of the same type where they will get auto concatenated, try adding one more field with different value for each data set so that you can identify the data set.

[DataSet1]:

LOAD .......,

1 as NewField

from ....

[DataSet2]:

LOAD .......,

2 as NewField

from ....


Have NewField as a filter and as you select 1, data will be shown from dataset1 and from dataset2 when you select 2.


Or else you can manually give them in set analysis in expressions.



Cheers,

Naresh

Not applicable
Author

Yep it's datasets that what structure is the same - but has different origins,

So what I should do;

is add a column in the dataset @ loading time with something that ie. identifies the tablename

and make selections on the column value ie. <TABLE_ID = {'PRD'},......

Thanks for the discussion !

simondachstr
Luminary Alumni
Luminary Alumni

Or you could also use the filename() function to receive the Filename of your origins. This only makes sense if you are pulling data from files, though.

Load *, filename( ) as X from

C:\UserFiles\abc.txt

Will return 'abc.txt' in field X

reddy-s
Master II
Master II

Hi Richard,

I am assuming that you are looking to exclude data in a table based on specific field in another. For this you can make use of the Exists() in the where clause or by using a Left Keep(). Both will work just file

Check these out for more details:

Dual &amp; Exists – Useful Functions

Keep Left or exists

Thanks,

Sangram

ogster1974
Master II
Master II

Adding a dataset identifier field is the way to go so you can concatenate all your facts together in one table.

I would then also modify my key to include the identifier so the key will remain unique.

Example

Key, Data Set, Value

1,A,1000

2,A,100

3,A,5000

Key, Data Set, Value

1,B,2000

2,B,50

3,B,500

Combined would be

Key, Data Set, Value

A1,A,1000

A2,A,100

A3,A,5000

B1,B,2000

B2,B,50

B3,B,500

simondachstr
Luminary Alumni
Luminary Alumni

Sangram, I do not think what you are assuming is correct. He wants to filter values coming from a specific source in an expression on the front end. Keep left or exists() are scripts methods.

Not applicable
Author

Correct Martin