knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

V4 accounts almost always need brand IDs in their filters. There are two ways to go about finding Brand IDs, one in Analyse, and one in RStudio.

  1. In the Filter Panel, create a filter using the brands that you want to use. When you ask to see the Advanced Filter, you'll be able to see the IDs.
  2. Look up the IDs in RStudio using brandseyer2.

Both of these options are described below.

Using the Advanced Filter panel

One way of finding brand IDs is to use the filter panel in the app. Create a filter selecting the brands that you want, and then ask to see the Advanced Filter. The brand ids will be in the filter, in sections that look like:

brand isorchildof 1234

Where 1234 will be a brand ID.

Using brandseyer2

There is a simpler way to find brand IDs, using brandseyer2. brandseyer2 was automatically installed if you're using this charting library. The process of using brandseyer2 is to first specify which account you're interested in, and then to ask it to look up either the account's root brands, or all of the account's brands if you want a sub-brand.

Here is an example that uses root_brand() to list root brands for a simple test account, TEST01AA.

(You can copy and paste this code in to RStudio to play with it. Try using an account that you're familiar with.)

library(brandseyer2)         # Load the library

account("TEST01AA") %>%      # Choose the account that you want 
  root_brands()              # Ask for root brands

The id column gives the brand ID for you to use in your filter. The parent column gives the ID of the brand's parent brand (for root brands this will always be NA, or "Not Applicable"). deleted will indicate whether the brand has been deleted or not, and archived will give a date that the brand was archived, or NA if it is unarchived.

By default, root_brands() will only show brands that are undeleted and uncharived.

If you want to find a deleted root brand, you can do so with an extra argument:

account("TEST01AA") %>% 
  root_brands(includeDeleted = TRUE)

And can also include archived brands:

account("TEST01AA") %>% 
  root_brands(includeArchived = TRUE)

If you want to find brands that are not root brands, you can use the brand() function, like so:

account("TEST01AA") %>% 
  brands()

For accounts that have many brands, you can view the brands as a table in RStudio, like so

account("TEST01AA") %>% 
  brands() %>% 
  View()   # See in a table view.


brandseye/chartingtest documentation built on May 15, 2019, 3:17 p.m.