cancel
Showing results for 
Search instead for 
Did you mean: 

How to filter by user in a calculation view?

jonathan_viau
Employee
Employee
0 Kudos

Hello community,

I created a graphical calculation view in HANA.

In one of my tables, I have the user_name as a column.

I would like to filter the content of that table based on the session_user connected.

Do you know if this is feasible in a graphical calculation view with a session variable like $$client$$?

The only way I found so far would be to create an SQL script view to return the session_user and then join the two views together.

Best regards,

Jonathan

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

hi experts,

even i am doing the same scenario where i need to give access to the table regarding the session user.

i have got the session user by using sql script view, now how can i get the users in calculation view and join it to the table ??

former_member226419
Contributor
0 Kudos

Hi Jonathan,

But I didn't get  what is the issue if we create one scripting view and get list of users and joining the same with other view having list of users?

And if you want to restrict it to some users, you can create analytical privileges on the same.

BR

Sumeet

Former Member
0 Kudos

Hello Johnathan,

Were you able to find a solution to your problem using expression editor or did you end up creating a script view? I also have similar requirement where I want to filter the data based on SESSION_USER.

Thanks,

Aamod.

jonathan_viau
Employee
Employee
0 Kudos

Hello Aamod,

I had to use a scripted view. I was able to combine it with additional logic I had and not create a view simply to return the session user.

Depending on your need, you can also use analytical privileges to achieve this. However, we noticed that the performance is a bit slower using analytical privileges vs using a direct filter in the view.

Best regards,

Jonathan

former_member182302
Active Contributor
0 Kudos

Hi there,

You can use Analytic privilege on top of a repository procedure ( which uses SESSION_USER ) and then have the results you are looking out for.

Have a look on this blog:

Regards,

Krishna Tangudu

jonathan_viau
Employee
Employee
0 Kudos

Thank you for the proposition.

However, I am looking for a way to minimize the security maintenance effort.

If I could use function SESSION_USER directly in the filter of my calculation view, it would solve my issue and would be secured at the same time for all users.

Regards,

Jonathan

former_member182302
Active Contributor
0 Kudos

Ho yes.. I was also looking for the same for a different requirement and eventually left out to use SESSION_USER for Script based view.

I also wish there is such a option. Will be waiting along with you.

Regards,

Krishna Tangudu