XBRL Query Tags
In CDM XBRL, you can create an XBRL tag against a relational query where each row in the relational query result represents an XBRL fact.
An aspect of the fact can be derived dynamically from a column in the row, or directly from an aspect that is associated with the project. You can use an XBRL query tag to automatically tag many facts at the same time.
Add an XBRL Query Tag from a Relational Query
You can use an XBRL query tag that is created from a relational query in CDM XBRL to create many facts dynamically, depending on the number of rows in the relational query.
Before you can work with query tags in CDM XBRL, at least one XBRL project must be created for your report and it must have at least one relational query that is visible to that report. A project is a container that is used to store the tags that make up an instance document. The project's Enable Relational Query Tagging option must be enabled.
When you create the query in the Add Relational Query wizard, you must either select the report associated with this project or the Make This Query Global checkbox to make the query available to all reports. Otherwise, you cannot see the query in the Report queries pane.
To add an XBRL query tag from a relational query:
- Open the project that you want to work with.
- In the Data Tools area on the ribbon, click Pivot Grid.
- Above the Tag Inspector tab, click Pivot Grid.
- In the Report queries pane, double-click the query that you want to tag. The query must be against a relational database.
- Click Tag.
- Complete the steps in the Query tag wizard. Depending on your scenario, you might not see all of the following steps.
- In the Concept step, select a concept member to create tags against.
- In the Value column step, select the column from the query that contains the fact values. Optionally, select a transformation, a decimal accuracy value, or both.
- In the Time Period Aspect step, select the time period aspect.
- If you select Direct as the type, under Time period you have a choice of time period aspects associated with the project.
- If you select Column as the type, and if you select the Column values are aspect names checkbox, under String type column you have a choice of all columns that return string types. This means that the column contains strings that match the name of a time period aspect in the current project.
- If you select Column as the type, and if you do not select the Column values are aspect names checkbox, then you have two choices.
- If the concept is a duration type, you have a choice of start and end date columns. These columns should contain date values that represent the start and end dates respectively. If a date does not match an existing time period aspect in the current project, an ad hoc time period is created. Ad hoc time periods are time periods that are automatically created on behalf of the user just for the query tag. This allows the user to use time periods for the query tag without manually creating all of them.
- If the concept is an instant type, you have a choice of a single date column. This column should contain date values that represent the instant date. If a date does not match an existing time period aspect in the current project, an ad hoc time period will be created. Ad hoc time periods are time periods that are automatically created on behalf of the user just for the query tag. This allows the user to use time periods for the query tag without manually creating all of them.
- In the Unit step, select the unit aspect.
- If you select Direct as the type, under Unit you have a choice of all the unit aspects in the current project.
- If you select Column as the type, under Unit column you have a choice of all columns that return string types. This means that the column contains strings that match the name of a unit aspect in the current project.
- In the Entity step, select the entity aspect.
- If you select Direct as the type, under Entity you have a choice of all the entity aspects in the current project.
- If you select Column as the type, and if you select the Column values are aspect names checkbox, under Entity column you have a choice of all columns that return string types. This means that the column contains strings that match the name of the entity aspect in the current project.
- If you select Column as the type, and if you do not select the Column values are aspect names checkbox, under Entity column you have a choice of all columns that return string types. This means that the column contains strings that match the value of the entity aspect in the current project.
- In the Explicit dimension step, select the explicit dimension associations. For each dimension in the Dimension Name column, select a Column or Direct dimension in the Associations column. If you select a column, this means that the column contains strings that match the element ID of a explicit dimension member in the current project.
- In the Typed dimension step, select the typed dimension associations. For each dimension in the Dimension Name column, select a Column or Direct dimension in the Associations column. If you select a column, the Column values are aspect names checkbox is available in the Settings column. If this checkbox is selected, column values must match the name of a typed dimension member. If this checkbox is cleared, the column contains actual typed dimension values. If a typed dimension value does not match an existing typed dimension value in the current project, an ad hoc dimension value is created. Ad hoc dimension values are typed dimension values that are automatically created on behalf of the user just for the query tag. This allows the user to use typed dimension values for the query tag without manually create all of them.
- Click Finish to create the query tag.
Query tag additions are done through a process which can be queued due to the activity of other query tagging processes that are also running in CDM XBRL. The All processes completed window in the status bar displays the progress.
- If the query tag was created properly, a check mark appears in the window. In the confirmation message that opens, if you want to refresh data in the Pivot Grid, click Yes.
- If the query tag was not created properly, an exclamation mark in the window indicates an error that stopped the query tag creation, and the Validation Messages tab displays any errors.
After the process has successfully completed, and after you redisplay the Pivot Grid, you can see the query tag and its facts that you added.
Refresh XBRL Query Tags
You can refresh the XBRL facts create by all relational query tags in CDM XBRL.
Before you can work with query tags in CDM XBRL, at least one XBRL project must be created for your report and it must have at least one relational query that is visible to that report. A project is a container that is used to store the tags that make up an instance document. The project's Enable Relational Query Tagging option must be enabled.
When you create the query in the Add Relational Query wizard, you must either select the report associated with this project or the Make This Query Global checkbox to make the query available to all reports. Otherwise, you cannot see the query in the Report queries pane.
To refresh XBRL query tags:
- Open the project that you want to work with.
- In the Home tab, click Refresh XBRL.
- To fetch the latest data for all the report objects in the current project, in the Refresh XBRL window, click Quick Refresh.
- To fetch the latest data for all the report objects in the current project and also the data from all data sources, in the Refresh XBRL window, click Full Refresh.
When you perform a quick or full XBRL refresh, items and facts created by the query tag are regenerated from the data source.
- Select the Include query items in the refresh checkbox. You can see this checkbox only if the Enable Relational Query Tagging checkbox is enabled in the project.
Tip: When you include query items in the refresh, more time is required for the refresh to complete.
- Click OK.
Delete an XBRL Query Tag
If you no longer need a relational query tag in CDM XBRL, you can delete it along with all the XBRL facts that it created.
Unlike regular content tags in XBRL, query tags can be deleted in the Tag Inspector only.
Important: If you delete a query tag, you cannot undo your action. Proceed with caution.
To delete an XBRL query tag:
- Open the project that you want to work with.
- In the Tag Inspector tab, click the Project tab.
- Highlight the row that contains the query tag, and click Delete. You can delete multiple query tags at one time.
- In the confirmation window that opens, click Yes to delete the item.
Query tag deletions are done through a process that can be queued due to the activity of other query tagging processes that are also running in CDM XBRL. The user interface does not automatically reflect the deletion of the query tag. You will be prompted to redisplay the Pivot Grid after the process has successfully completed.