AnsweredAssumed Answered

Is there a complete example of how to use groupbyid in aftransformer

Question asked by matt.au on Mar 6, 2018
Latest reply on Jun 27, 2018 by matt.au

I'm starting to use AFTransformer to generate my AF database. Looking through the XML reference manual the tool supports GroupById and has an example of it. However, there is no mention of the input or what it outputs, thus it is very difficult to know how to use GroupById. Are there any examples of using it which include the input database and  AFTransformer XML?

 

What I'm trying to do with GroupById is use it to read in a flat set of tags in an AF database. I'm stating small and only working with water reservoirs in our system and only volume (amount of water in the tank) and level (height of the water column in the tank in feet). The tag structure has an "LIY" in it for the volume and an "LI_" for the level. There is one volume per reservoir and one or more levels. Long story, but a single reservoir can have multiple cells for storing the water and the cells have levels. A strapping table is used to calculate the volume of each cell. The sum of all these individual cell volumes is stored as the volume of the reservoir. The SCADA system stores individual cell levels but only a single sum for the entire reservoir volume. Example tags look like:

 

SITE1_LIY_7050

SITE1_LI_7050A

SITE1_LI_7050B

SITE1_LIY_7051

SITE1_LI_7051

 

Which is to say, site 1 has 2 reservoirs. Reservoir 1 (id=7050) has a volume (LIY_7050) and 2 cells, thus 2 level tags (LI_7050A and LI_7050B). Reservoir 2 has a volume (LIY_7051) just 1 cell and level tag (LI_7051).

 

It's easy to break out the number part from the very last suffix ("A", "B" etc), which I'm doing in Excel and loading the input AF tag database with nicely parsed out tag name components. My thought is to write a single AFTransformer XML script to group the tags into an element for the reservoir volume and sub-elements for the levels. GroupByID seems like a good fit, but the examples given are just not complete enough to understand how the grouping actually works and how to use the groups for writing the data out.

Outcomes