Clarity

Expand all | Collapse all

Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?

Jump to Best Answer
  • 1.  Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?

    Posted 09-24-2015 02:23 PM

    Hi all,

     

    Hopefully you might be able to provide some guidance, and I appreciate any help you might be able to provide.

     

    Anyway, the context is that I'm trying to filter Projects. Each Project is supposed to have a single task with a flag. I want to filter for the projects that have 0 or more than 1 of those tasks with the flag. Currently...

     

    !any("task", task.priskey == 1, project.odf_pk, ctx)

     

    ...will show me all the projects that do not have at least one task with that flag. Can I do something like...

     

    !any("task", count(task.priskey) == 1, project.odf_pk, ctx)

     

    Thanks for any help you might be able to provide.



  • 2.  Re: Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?
    Best Answer

    Broadcom Employee
    Posted 09-24-2015 06:00 PM

    Currently, there is not a way to do it in the UI for versions 14.2 and below.

     

    However, with the new release coming out with the new functionality for 'Aggregate Calculated Attribute' ; you will be able to accomplish this use case.

    In the new 14.3 (Eltz ) release do the following steps:

     

    For example if you want to list projects based on the number of key tasks

     

    1. In Studio: Objects, Create a new attribute on the Project Object

      Attribute Name = 'Count Key Tasks'

      Data Type = Aggregated

      click 'Save' button

     

    2. Click 'Build Aggregate Calculated Attribute'

      Function = AGG_Count

      Sub Object = Task

      Attribute = Key Task (task.priskey)

     

    3. Add the attribute to the List View Filter section or use in a power filter



  • 3.  Re: Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?

    Posted 09-24-2015 10:23 PM

    That's what I was afraid of - my enterprise is back on Clarity 13.1 or something like that.

     

    I'll be waiting for that upgrade with bated breath. Thanks!



  • 4.  Re: Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?

    Broadcom Employee
    Posted 06-06-2016 12:10 PM

    For showing Zero or More than 1, do the following:

    any("task", task.priskey > 1, project.odf_pk, ctx) || any("task", task.priskey == 0, project.odf_pk, ctx)



  • 5.  Re: Is there a way to use Power Filter to filter on a COUNT of a certain subobject type?

    Broadcom Employee
    Posted 06-07-2016 10:48 AM

    And if you want a count in the UI, just add an Aggregation row and count the project ID or some field like that.