Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Vilius
Contributor III
Contributor III

Filtering by non-existent data type

I have such data model:

Requests

req_idreq_name
1Sales Request Nr. 1
2Sales Request Nr. 2
3Sales Request Nr. 3
4Sales Request Nr. 4

 

Request Types

type_idtype_name
1Cargo
2Passenger

 

RequestType Link Table

req_idtype_id
11
42

 

All tables are joined via Data Manager. Request Nr. 2 and Request Nr. 3  in the linking table doesn't have Request Type set, but it is known internally for our salesmen that all such requests should be considered Passenger requests.

 I want to create a Filter Pane which would allow me to filter requests by request type. The Filter Pane itself is not an issue, but I cannot wrap my head around how to do filtering correctly for our supposed rule that all requests without types are Passenger requests. If I select "Cargo" it is filtering fine, but if I select "Passenger" I only get Request Nr. 4. I need to select rows 2, 3 and 4 somehow. Any ideas?

2 Replies
martinpohl
Partner - Master
Partner - Master

Change your script:

ReqMap:

mapping load

req_id,

type_id

from Yoursorce;

Requests:

load

req_id,

applymap('ReqMap',req_id,2) as type_id,

req_name

from Yoursource;

Regards

Vilius
Contributor III
Contributor III
Author

My tables are imported and connected via Data Manager, not the script, and there are a lot more Sheets and related tables in my application, so I would rather not change the data model.

Is it possible to achieve this with some kind of clever Set Analysis filter or something like that?