Forum Discussion

kabra_ashish's avatar
kabra_ashish
Helper III
6 years ago
Solved

Rank function bypasses row level security

Assuming I have the below table with the rankings:

 

Country         Customer_ID         Total_Spend      Rank

USA                 U_ABC                          $100             1

USA                 U_DEF                           $200             2

USA                 U_GHI                           $300             3

Germany          G_JKL                            $100             4

Germany          G_XYZ                           $100             5

 

I have the Row-level security implemented in my data model based on country. When the users who have access to only Germany the rank for the customers  appears as G_JKL is 4 and G_XYZ = 5 whereas I want them to be 1 and 2 respectively. It seems that rank does not re-calculate on the basis of row-level security of filters? Instead it takes the entire data.

 

Can someone please help me out here? Basically I am looking the rank to be re-calculated on the basis of row-level security

 

  • kabra_ashish 

     

    Here is a measure version that utilizes that rank column to give you the result when filtered to by RLS to Germany:

     

     

4 Replies