Calculate Row count metric based on teh dimensions
Asked by Shraddha:

Hello Team,

I build a report based out of Assets metadata in the schema. Since the columns are pivoted meaning they are attribute values for a column "Name" i am unable to develop an aggregate formula based on the logical grouping.

See the attached report screenshot

![Screen Shot 2023-11-15 at 4.13.33 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/291943i776FA411B2B1C584/image-size/large?v=v2&px=999 "Screen Shot 2023-11-15 at 4.13.33 PM.png")

I want something like this where the Hardware Name(assets) are grouped by Hardware Type, Status and Stockroom. (PDX is the Stockroom example value and In Stock : New is the status and the associated count)

![Screen Shot 2023-11-15 at 4.15.19 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/291944i1FF60E65A3446196/image-size/large?v=v2&px=999 "Screen Shot 2023-11-15 at 4.15.19 PM.png")

Also how to further add controls for "Stockroom" and " Status" in the dashboard given these columns are attribute values.

Looking forward to the support help. Thanks


Answers:
author: Tracy Chow
body: Hi Shraddha,

If you would like to group by Stockroom, you can add a ["Group \& Aggregate" step](https://support.atlassian.com/analytics/docs/visual-sql-steps/#Group--amp--aggregate) and do a "Count of unique" aggregation for the Stockroom column. Can you give that a try and see if it generates what you're looking for?

Secondly, to add a control for an attribute value, you can add a dropdown control and select **Switch to control editor** to further customize the control.

From there, you can add the "Attribute value string" column to get the attribute values and then add the "Name" column from the "Assets type attribute metadata" table to filter it by attribute name.

![Screenshot 2023-11-16 at 5.30.06 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/292354iF684637A38C370E6/image-size/large?v=v2&px=999 "Screenshot 2023-11-16 at 5.30.06 PM.png")

Please let me know if you have further questions or if I can clarify anything.

comments: author: Shraddha
body: Thanks [@Tracy Chow](/t5/user/viewprofilepage/user-id/4461730)

How does the controls(filter) associate with the chart. They seem to be created separately as in when dropdown values are selected that filter value does not reflect in chart.

I am curious how to pass filter(dropdown) value for a attribute value string?


author: Tracy Chow
body: Yes, a control needs to be connected to your chart in order for it to filter according to the control selection. [This article](https://support.atlassian.com/analytics/docs/set-up-a-dropdown-control/#Connect-a-%E2%80%9CDropdown%E2%80%9D-control-to-charts) walks through some examples of connecting a "Dropdown" control to charts.

You can either add a filter in the Filters section of your visual mode query, or add a ["Filter" step](https://support.atlassian.com/analytics/docs/visual-sql-steps/#Filter) after your query to filter it by the control.

Feel free to [open a support ticket](https://support.atlassian.com/contact/#/?inquiry_category=technical_issues) with us to look at your chart together or schedule a call if desired.


author: Shraddha
body: Hi [@Tracy Chow](/t5/user/viewprofilepage/user-id/4461730)

Thank you for the information.

My issue with having control filter connect to a chart is that , I have attribute value string pivoted as columns in the chart.

To be able to connect control filters in charts those need to be real columns in the schema.

I could not find document and help in the community for that case. How can i get further assistance.

Thanks


author: Tracy Chow
body: Hi [@Shraddha](/t5/user/viewprofilepage/user-id/4459242), thanks for the clarification. Do you mind [opening a support ticket](https://support.atlassian.com/contact/#/?inquiry_category=technical_issues) (selecting "Atlassian Analytics" as the product) and granting data access so I can look at your dashboard further?

I believe it's possible to achieve what you're looking for, but without seeing how your chart and controls are set up, it's difficult for me to recommend a solution.

Happy to schedule a call as well so we can look at it together.


author: Shraddha
body: Hi [@Tracy Chow](/t5/user/viewprofilepage/user-id/4461730) raised the support ticket with data access -

++<https://support.atlassian.com/requests/JST-940138/>++