Aggregating a Dimension Into List of Unique Values

Hi -

Is there a way to aggregate a text dimension into a list of unique values in AQL? My intention is achieve a single field with a list of all relevant values per line rather than adding in the dimension and having each unique value split into a new line.

1 Like

Hi @hannah.paxton
Thank you for sharing your use case. I believe our AQL’s unique could help.

Raw data:

Create an AQL Metric with unique to aggregate unique values of a Dim. The result would be:

I hope my reply could help answer your use case.

1 Like

Exactly what I was looking for - thank you!

Hi Tai,
Thank you for pointing us to the unique() AQL function. Very helpful!
One thing I discovered when using this function is that the ‘pill’ visualization of unique values (like you have in your examples) is replaced by an array when changes are made on the same canvas dashboard. This converts your example to [“New York”,“Chicago”] in the visual.

I tested this on a handful of simple canvas dashboards and have confirmed that even adding a comment in the code causes the visualization to revert to an array from the pill format.

Thank you,
Bob

Hi @Bob_Adams, Thank you for bringing this issue to our attention. Our engineers have identified this as a bug on our end. We are actively working on a patch to resolve this and it should be available soon.

I will keep you updated and inform you as soon as the patch is released. We apologize for any inconvenience this has caused you and your team.

Thank you for your patience.

1 Like

Hi @Bob_Adams,
I hope you’re doing well.

I wanted to let you know that the issue has been fixed. Please feel free to check on your end, and let me know if everything is working as expected.

Thank you for your patience and understanding.

Hi @Tai_Nguyen,
Thank you for the follow-up. I tried this in canvas dashboarding and confirmed it works!
Thank you,
Bob