brands.Rmd
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.
Both of these options are described below.
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.
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
#> # A tibble: 2 x 4
#> id name deleted archived
#> <int> <chr> <lgl> <dbl>
#> 1 1 Your Brand Here FALSE NA
#> 2 2 Sibling Brand FALSE NA
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)
#> # A tibble: 3 x 4
#> id name deleted archived
#> <int> <chr> <lgl> <dbl>
#> 1 1 Your Brand Here FALSE NA
#> 2 2 Sibling Brand FALSE NA
#> 3 5 So deleted TRUE NA
And can also include archived brands:
account("TEST01AA") %>%
root_brands(includeArchived = TRUE)
#> # A tibble: 3 x 4
#> id name deleted archived
#> <int> <chr> <lgl> <dbl>
#> 1 1 Your Brand Here FALSE NA
#> 2 2 Sibling Brand FALSE NA
#> 3 6 Brand of Christmas Past FALSE 1516710018.
If you want to find brands that are not root brands, you can use the brand() function, like so:
account("TEST01AA") %>%
brands()
#> # A tibble: 5 x 5
#> id name parent deleted archived
#> <int> <chr> <int> <lgl> <dbl>
#> 1 1 Your Brand Here NA FALSE NA
#> 2 2 Sibling Brand NA FALSE NA
#> 3 5 So deleted NA TRUE NA
#> 4 6 Brand of Christmas Past NA FALSE 1516710018.
#> 5 3 Niece Brand 2 FALSE NA
For accounts that have many brands, you can view the brands as a table in RStudio, like so