Knowledge Base
Creating an Access Rule with NQL in Data Studio
Creating an Access Rule with NQL
In Narrative's Data Studio, Access Rules let you control who can access specific subsets of your datasets, how they can use the data, and the licensing and pricing for data access. This guide will show you how to create an access rule using NQL (Narrative Query Language).
Demo
Prerequisites
- Familiarity with Data Studio.
- At least one dataset loaded into your Narrative account.
Steps to Create an Access Rule with NQL
- Navigate to Data Studio
- In the Narrative platform, go to Data Studio.
- Select the Query tab to start building a query.
- Add a Data Source
- In the Query Builder section, click + Add under Sources.
- Choose your data source. For NQL, select the NQL option to define a custom query.
- Define Your Query
- Use NQL to specify the subset of data you want to include in the access rule.
- Refer to the Data Studio Introduction for guidance on writing NQL queries.
- Set Output Fields
- Under Output, click + Add to specify which fields from the dataset should be accessible.
- Select the fields you want included in the output of your access rule.
- Apply Filters (Optional)
- Click + Add under Filters to narrow down your dataset based on specific criteria (e.g., country, age).
- This step is optional, but it allows you to control which data is accessible based on certain parameters.
- Define Limits (Optional)
- Click + Add under Limit to set restrictions on the number of rows returned in the query output.
- Validate
- Ensure all fields are valid, then click Validate to check for any issues.
- Configure Access Rule Details
- In the top right, click Create access rule.
- Complete the following fields in the access rule configuration panel:
- Unique Name: Enter a unique name for the access rule. This field cannot be edited after the rule is activated.
- Description: Provide a description of the data and purpose of the access rule.
- Tags: Add tags to categorize the rule.
- Price (CPM): Set a price per thousand rows (if applicable).
- Collaborators: Specify whether certain collaborators can access this rule.
- Image URL: Optionally, add an image URL for visual identification.
- Save
- Once validated, click Save to activate the access rule.
- Review Your Access Rules
- To view or edit active access rules, navigate to My Data > Access Rules.
Overview of Access Rules
Access Rules are central to controlling and managing data access within Narrative’s platform. They function similarly to database "views" by allowing you to create specific data subsets with governed access and usage rights.
Key Components of an Access Rule
- Query: Defines the subset of data accessible by the rule. This subset acts as a new dataset, accessible by collaborators without creating a physical copy.
- Policy: Outlines guidelines for data usage, including access permissions, allowed operations, and output rules.
- Governance: Sets licensing and pricing for data access, ensuring compliance with terms and conditions.
Output Options
The output of an access rule is a view on top of at least one dataset from your company's account, configured to be accessed only by authorized entities as per the rule's setup.
For more details on Data Studio and creating NQL queries, refer to the Data Studio Introduction.