ATTR, is all of the confusion worth it?

The attribute function (ATTR), as highlighted on Andy Kriebel's YouTube channel, is often hard to get one's head around. However this does not necessarily need to be the case. So... what is it, and how can it be useful?

In short the ATTR function scans each row of the dataset and returns the unique values of that row. When there is more than one value contained within that row the data is replaced with an asterisk(*).

For example, as shown below, we are analysing the number cities within the United States per State or Province.

As we can see, there are a number of instances where more than one city resides within a single state. This can potentially be misleading to the audience of this visualisation, therefore ATTR can help rectify this mishap.

With the help of the ATTR function, the states of California, Minnesota, Texas, Virginia, Alabama, New York, Washington, Colorado and Illinois have been replaced with an asterisk.

The point of this function is to prevent you from displaying misleading data. Therefore, in the quest for accuracy, clarity and consistency the ATTR function can be incredibly useful.

For a more in-depth guide on the ATTR function, and for more examples of it in use, Andy Kriebel's video upon this topic is linked below.

Author:
Ben Winsey
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab