Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Software ==> | SSAS - tabular (30 exercises) |
Topic ==> | Security (2 exercises) |
Level ==> | Harder than average |
Subject ==> | SSAS training |
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
If you haven't already done so, run the SQL script referenced in other SSAS Tabular exercises to generate a database (not for commercial use or copying) called MAM.
Create a new project and model, and import the following tables: tblAnimal, tblProduct, tblSpecies, tblTransaction. Create a measure in the transactions table to show total quantity sold.
Create a role called Penguins only, with a row filter which says that you should only be able to see data from the Animal table when the following conditions hold:
Condition | Notes |
---|---|
Animal is a penguin | The AnimalName column for the query context is Penguin |
CustomData is set | The CustomData information in the connection string passed in is set to Penguin lovers. |
Analyse your model in Excel using the Penguins only role, to get the following pivot table:
This is showing quantity sold by product, but the role isn't allowing you to see any data.
Now amend the connection string in Excel to include the following phrase:
The text to add to your connection string (the rest of the string will be different, of course, on your machine).
Refresh your pivot table if necessary to get:
You should now be able to see your penguins!
Now go into Management Studio and run the script called Create table of authorities.sql from the folder at the top of this exercise. This should create the following table of authorities:
A table showing which roles have access to which data.
Import this table into your data model.
Create two roles with read access to data, and set row filters for the Animal table as follows:
Role | Access to animals table |
---|---|
BG | If you can find a row in the tblAuthority table where the Person is Bear Grylls and the Animal matches the AnimalName for the current query context, return TRUE(); otherwise, return FALSE(). |
Others | The same logic, but this time looking for Everyone else. |
Analyse your model in Excel using the BG role - you should see only the following animals:
The animals made visible by the BG role.
Manually edit the connection string in Excel to use the Others role, not the BG one, to see:
The data for cute and cuddly (or at least, safe) animals.
Optionally, save this workbook as Most deadly, then close it and your model down.
You can find other training resources for the subject of this exercise here:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.