Could you please elaborate more?
I have created a cube based on 'Sales' persistent class. Then I created an hierarchy and added a Branch level based on Branch property. Then I compiled the class. After that I used Studio to manually add members to that level and built the cube. I removed the 'NON EMPTY' part of the MDX query.
As a result, now it only show facts for branches that are specifically mentioned in 'Members' tag of the cube definition AND have a matching fact in the table.

Assuming a table like this (omitting the ID column and some others)

Branch Date Sum
Western branch 2021-03-15 35,000
Eastern branch 2020-12-11 37,000
Eastern branch 2021-01-29 12,000
Northern branch 2021-02-03 14,500

And I need to show the amount of sales in 2021 with the result like this:

Branch Count
Northwest 1
Oriental 1
Southern 0

 

Where Northwest matches sales that happened either in a Northern or Western branches, Oriental matches sales that happened in Eastern branches, and Southern matches sales that happened in Southern branches.

Union seems to achieve what I want.

I am unsure what did you mean by using IN though.

The problem I was facing was aking to this:
I have a table called 'Sales' with a column called 'Branch' which holds the data of where the sale occured. I need to show all sales that occured in a specific time period for all branches, even if a branch had zero sales. The catch is there is no separate table that holds Branches so there's nothing I can join with AND I need to modify the values of the column 'Branch' a bit (e.i. some branches should be considered as one, some branches should have their name changed, etc.).

So the best possible solution I could find was to use Table Value Constructor to create the list of needed branches in the query and join it with a partially filtered table to get those Branches with 0 sales.

Well, a Data Connector seemed like the most logical solution. Just put the query into the data connector class, but the documentation got the best of me and I failed.

Defining a new class seems like much more work, since I'd need to manually repopulate the table or set it as a task.

So far I am getting by by simply rendering the data within a CSP application and might not pursue the use of DeepSee anymore.

But the method will be called from a CSP page, and accessing that page will be the application user.
I don't see a way to decouple the logic.

How safe is it to give random users access to %SYS? At this point I am thinking about abandoning the whole idea and just use some crutch to get user properties.

Does this method require some additional priviliges for the current user? I am getting a CSP error that does not get logged when I attempt to call a function like this with a test user with limited rights. When I call this function from my own account in terminal, it works.

I tried following your advice, but it still behaves... weirdly.
Today I've opened and changed a CSP file that is in a physical folder. When I tried to access it through the CSP application, I've got an error saying no such page was found on the server. After that, I also compiled this same file, but in the virual folder (the one created for the application). And it loaded normally.

Since CSP does not actually write errors, is it possible to catch them somehow?
I.E. there are custom error pages (for individual pages and whole applications) - would I be able to display the error on a page?

There are no subfolders, so it has nothing to do with recursion.
Disabling automatic compilation did not change anything.