Can we do a Cartesian Join in Quicksight at dataset level?

Hi!,

I’m relatively new to quicksight and have this requirement where I have a multi-value column coming from custom SQL query, like below and data is decently big.

NULL
[“0”,“2”]
[“0”]
[“1”,“0”]
[“1”,“2”,“3”,“4”]
[“1”,“2”,“3”]
[“1”,“2”,“4”,“6”]

Hence, I have an excel maintained which maps all these number to their corresponding Names. What I need to do is, I need to use this field in a parameter, so that, on selecting this field/Dimension, it will show me the count for each value individually i.e. for 1, 2, 3, 4, 5 and 6.
For this purpose, I thought i’ll make a join of Excel and the custom query with a Cartesian Join, which requires a calculated field and then work on the parameter through contains() function later.
But unfortunately, Quicksight doesn’t allow joins on calculated fields. Hence, is there an another way to make this join?
or if there’s an another way to handle this situation.

PS: I have more dimensions like this in my data with up to 8 values in a column and I need to add all these dimensions in a single parameter.

Any help would be appreciated.

Many Thanks!
Himani

Hi @HimaniS

I would recommend to use UNNEST functions (based on the datasource) in CUSTOM SQL to flatten array to rows . This will give us better flexibility to write complex analytical queries.

Below is sample SQL on ATHENA using UNNEST to expand array to rows.

Please check similar function in your datasource or let us know datasource type will check.

Thanks
Vinod

1 Like

Hello @apjvinod ,

Thanks for responding us back , I am trying to use above option. However we don’t want to use UNNEST() function at DB level unless there is no other option left . As the amount of data is huge , Is there any other way in QuickSight to Pivot the data from the columns we get from DB ?