1
我的原始數據結構是這樣的:查詢共享驅動器的權限層次與Conditons在PowerBI
ID SecurityGroups_CLEAN EDIT_Drive.1 EDIT_Drive.2 READ_Drive.1 READ_Drive.2 DENY_Drive.1 DENY_Drive.2 DENY_Drive.3 Fullname_CLEAN
15 HighStaff L Drive null null null null null null Smith, John
17 Foreign_National null null null null L Drive M Drive Q Drive Smith, John
23 Domain Users U Drive 2 null L Drive Q Drive null null null Smith, John
經過一番轉化,過濾,樞轉,刪除列等等......我已經成功地得到它看像這樣......
Fullname_CLEAN Drive Count Permissions
Smith, John L Drive 3 DENY_Drive.1
Smith, John L Drive 3 EDIT_Drive.1
Smith, John L Drive 3 READ_Drive.1
Smith, John M Drive 1 DENY_Drive.2
Smith, John Q Drive 2 DENY_Drive.3
Smith, John Q Drive 2 READ_Drive.2
Smith, John U Drive 2 1 EDIT_Drive.1
基本上,我需要應用以下邏輯來總結用戶驅動器級別權限。
- 如果用戶屬於在驅動器上具有拒絕權限的安全組,則無論另一用戶組是否授予他們在同一驅動器上的讀或權限權限級別爲拒絕。
- 如果用戶屬於在驅動器上具有「編輯」權限的安全組,則無論是否有其他用戶組爲他們授予對同一驅動器的讀取權限,其權限級別爲「編輯」。
- 如果用戶屬於在驅動器上具有讀取權限的安全組,則其「權限」級別爲「已讀」。
對於最終輸出:
Fullname_CLEAN Drive Permissions
Smith, John L Drive Deny
Smith, John M Drive Deny
Smith, John Q Drive Deny
Smith, John U Drive 2 Edit
現在,我才知道,因爲我的排序和純ABC重合的,我可以只取「的集合列的分」分組名稱後因爲D eny之前來過E dit之前來過R ead,這將反映我的條件。但是,我希望學習「正確」的方式來做到這一點。
感謝@MikeHoney,請參閱告訴你我會趕上快! –