Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Calculation View - Filtering Table1 where not in Table2

$
0
0

Hello Fede,

 

unfortunately there exists nothing comparable to the NOT EXISTS predicate in a graphical calculation view.

 

So you have two options.

 

The first option is to do the logic in a user defined table function which than acts a data source in a graphical calculation view.

 

The second option is following one which uses a dummy counter to filter out the not required data. This works in case the keys are compared against each other and each key is max. only one time available in the tables:

1) The projections on the bottom and the table with data and on the table containing the "not to be included" keys define a dummy calculated column which is just simply set to integer 1. This allows to do an aggregation later.

2) The union on both of the tables is done as precondition for the aggregation.

3) A sum aggregation is done for the dummy calculated column (containing the 1). This aggregation returns 1 for all keys just available in the "full data" table and 2 for the keys available in both tables.

4) In the following projection (called Filter) a filter expression is applied on the aggregated integer column. Only entries are considered with the value 1 -> so only entries are considered with a key not available in the "not to be included table".

5) Final join, joins the additional fields of the full table.

 

tmp01.JPG

tmp02.JPG

tmp03.JPG

 

Looks a little bit stupid, but it works . But of course if the "graphical only" approach is applied it has to be checked if the performance match the requirements.

 

Regards,

Florian


Viewing all articles
Browse latest Browse all 9165

Trending Articles