0

Assign Asset to 2nd level of all tags

I've got a View in which ever tag has 4 parts (separated by a period). In every tag, the 2nd level is known as the "area". I would like to assign an "Area" asset to the 2nd level of every single tag. Is that possible. I confess, I don't understand Asset Rules.

6 replies

null
    • smason
    • 13 days ago
    • Reported - view

    Hi ,

    I think rule 6 here will work for you.

     

    ^.+?\..+?\.
    
      • damon_vinciguerra.1
      • 13 days ago
      • Reported - view

       Thanks! I'll throw it in. Can you help me understand how Asset rules work? Like what is it doing? Does the rule have to start and end with \. and if a tag matches, what is in there becomes an asset? What if it matched multiple parts? for instance This rule 6 matches "something.something.". If my tag is "something.something,someting.something", how does Canary know to apply the asset to the 2nd something? Both the first and 2nd something are included in that search.

      • smason
      • 12 days ago
      • Reported - view

       

      In RegEx, the period means "any character". To escape that functionality or any other character's functionality, you prepend it with a backslash. So "\." is a literal period in the tag path. The reason we want to end on the period is because we use them to indicate a new branch in the tag path.

      So that rule would matching anything that has two branches and we would label the 2nd branch the Area. Anything that comes after it would be either a child asset or a tag. The last branch of a tag path can't be labeled as an asset. An asset should have at least one more branch after which would be the immediate tags of that asset.

      In this particular view the hierarchy is [Company].[Area].[PumpingStation##].[Pump## or Tower##]. The last 3 rules are looking for specific string values followed by a number, whereas rule 6 is more general. Anything that lands in the 2nd branch is an area.

      Hope this helps!

      • damon_vinciguerra.1
      • 12 days ago
      • Reported - view

       Unfortunately I'm not quite there. Rule 3 calls out a specific branch. But rule 6 includes 2 branches (the first and the second). So what about that is telling it that Area belongs in the 2nd branch and not the first?

      • smason
      • 12 days ago
      • Reported - view

      An Area has to start with two branches. So if we get to the 2nd branch in the hierarchy, we know we are at the Area level. That's why we would assign it to the 2nd branch, not the first. If we wanted to assign Area to the first branch, we would use rule 5 instead.

      • damon_vinciguerra.1
      • 12 days ago
      • Reported - view

       Alas, I'm still missing something fundamental here. I don't see how a generic rule that applies to multiple branches can assign a model to a specific branch. Maybe we can jump on a call one day and discuss it. Have a great weekend!

Content aside

print this pagePrint this page
  • 12 days agoLast active
  • 6Replies
  • 9Views
  • 2 Following