How to find unused attributes in an application

Introduction: What is attribute usage?

Attributes can have read and write usages.

  • A read usage corresponds to an usage in a dashboard, query, event or as input of a computed attribute.
  • A write usage corresponds to an usage in a mapping or when the attribute is computed.

How to find unused attributes of an application?

Generate attribute usage report

To find unused attributes of an application, open the shell and execute the generateIndicatorUsageReport command:

> generateIndicatorUsageReport

The result is printed in a comma separated format. For more information about how to read the results, see generateIndicatorUsageReport.

Analyze results

For each attribute, you must then look at the useful read usages and useful write usages columns.

Any attribute with 0 useful read usage or 0 useful write usage appears to be useless. You should investigate to determine whether it is useful or not.

If you have 0 useful read usage:

  • If you do not intend to later use this attribute in a dashboard, query, event or as input of a computed attribute:
    1. remove it from the mappings that use it
    2. delete it

If you have 0 useful write usage:

  • If you do not intend to later add this attribute into a Data integration Mapping then you should:
    1. remove it from the dashboards, queries, events and computed attributes that use it.
    2. delete it

If you have both 0 useful read and 0 useful write usages:

  • This attribute is unused, you can delete it.

Example

Model definition

Computed attributes definitions:

  • circle area = r * r * pi (constant)
  • sphere area = circle area * 4
  • named description = Concat(name , description)

Generate attribute usage report

Execute the generateIndicatorUsageReport command to get the following results.

Name Type Is configured Is computed Dashboard usages Indicator usages Event usages Queries usages Mapping usages Read usages Write usages Total usages Useful read usages Useful write usages Useful total usages
circle area Decimal true true 1 1 0 0 0 2 1 3 1 1 2
description String false false 1 1 0 0 0 2 0 2 1 0 1
named description String true true 0 0 0 0 0 0 1 1 0 0 0
sphere area Decimal true true 0 0 0 0 0 0 1 1 0 1 1
r Integer false false 1 1 0 0 1 2 1 3 2 1 3
name String false false 0 1 0 0 1 1 1 2 0 1 1
id String false false 1 0 0 0 1 1 1 2 1 1 2

Results have been truncated to ease visibility.

Analyze results

All attributes with 0 useful read usage or 0 write usage look useless.

In this case:

Attribute Description Conclusion
description has no useful write as no mapping fills it and it is not manually filled description has probably been forgotten to be mapped since we have one useful read.
sphere area has no useful read as no dashboard, event, query or indicator read it. sphere area has to be used into a dashboard, an event or a query, otherwise, it is useless.
named description has no useful read as no dashboard, event, query or indicator read it,
and no useful write as this computed attribute is based on an attribute (description) that is never written (no mapping)
it is probably useless.
 name has a read usage as it is read by an attribute (named description)
but has no useful read usage as named description is not useful (no read usage)
name or a derivation of name has to be used into a dashboard, an event or a query, otherwise it is useless.

Related Links