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: 
igalbald
Contributor II
Contributor II

Filter in load script

Hello,

I have two sources of data, one loading millions of lines and another one with only the line I am looking for.

Both have a filed of part number which I am using to associate the two tables. 

To make sure I see only the part numbers relevant to me, I created another column in my excel table with all cells containing the same value.

In analysts, I created a filter on this filed. When I select the only value it contains, the view goes from million part numbers to the list I required. The challenge is that the filter will reset every time I open the app.

How can I make this filter permanent or include it in the script?

Thank you

 

 

 

1 Solution

Accepted Solutions
igalbald
Contributor II
Contributor II
Author

I found a way to perform a permanent filter in the GUI. 
Thank you

View solution in original post

5 Replies
dplr-rn
Partner - Master III
Partner - Master III

use exists function.

step 1 load your inclusion id

step 2 load main table with exists function.

step 3 drop table from step1

e.g.

 

ValidIDs:
LOAD
    ValidIDs
FROM [lib://Downloads/Custom.xlsx]
(ooxml, embedded labels, table is MyValid);

MainData:
LOAD
    ID,
    Column1,
    Column2
FROM [lib://Downloads/Custom.xlsx]
(ooxml, embedded labels, table is Main)
where exists(ValidIDs,ID);

drop table ValidIDs;

 

bhavtan
Contributor II
Contributor II

example from help site

site

LOAD * inline

[ Employee|ID|Salary

Bill|001|20000

John|002|30000

Steve|003|35000 ] (delimiter is '|');  

Citizens:

Load * inline

[

Employee|Address

Bill|New York Mary|London

Steve|Chicago Lucy|Madrid

Lucy|Paris John|Miami ]

(delimiter is '|') where Exists (Employee);  

Drop Tables Employees;

igalbald
Contributor II
Contributor II
Author

The two tables I have include different fields that I need to keep, so I cannot drop the table.

The excel table I created includes a filed that includes a single value that I use to filer in the analysis tab.

I am looking to do this filter in the load script section.

Is it possible?

Thank you

dplr-rn
Partner - Master III
Partner - Master III

not 100% clear what you mean. but if you want to retain the table just dont drop the table.

excludes still works. (even in the sample script shared above.)

 

igalbald
Contributor II
Contributor II
Author

I found a way to perform a permanent filter in the GUI. 
Thank you