Forum Discussion

psc's avatar
psc
New Contributor III
3 years ago

UD8 Dynamic Calc - Aggregate Entities

Hello - Is there a way to have a Ud8 dynamic calc sum up certain entities based on a text field? I am trying to tag a text field on certain entities and have a dynamic calc aggregate the entities based on what that text is.

Example: 

entity 1 - text 1 "abc"

entity 2 - text 1 "abc"

entity 3 - text 1 "def"

I want the value of entity 1 + entity 2

 

Thank you!

 

    • psc's avatar
      psc
      New Contributor III

      I thought about that for a cube view potentially, but I'm not sure how to use a where clause on a dynamic calc? The few attempts I made at using where came out with an invalid script error. 

  • mroscelli's avatar
    mroscelli
    New Contributor III

    Hi psc 

    I have not done it with a dynamic calc, but in the past I have succesfully used an Attribute Member on UD8 configured to pick up a text on entities, and then used it in combination with C#Aggregated 

    To do it completely dinamically with a dynamic calc, as it goes across different data units, it would probably require access to databuffers in a loop (which is not a best practice as far as I am aware!)

     

    hope this helps

    Michele

  • You will need to loop through the desired list of members that was derived with an appropriate where Text Contains abc clause.  Within the loop, get the data cell you want for the entity, and accumulate that to a running total.