Closed mnifakram closed 4 years ago
Hey @mnifakram! Please see following links about ungrouped
option:
Also you could add these fields as dimensions and config display in your client code:
{
measures: ["Participations.count"],
dimensions: [
"Participations.participantId",
"Participations.activityId",
"Participations.participantName",
"Participations.stepDefinitionName"
]
}
Hey @RusovDmitriy! Thank you for the quick response
Jhon Doe
but with different id. So this is not an option, I think.Ungrouped
as far as I understand it will remove groupBy
from the generated SQL, Is there a way that I can add my own group by clause?two participants named Jhon Doe but with different id
- it is no problem, because participantId
and activityId
also included in the grouping.
If the possible situation with diff name but the same id - you could use aggregation funcs and rewrite base SQL for cube schema:
SELECT
id
participantId,
activityId,
STRING_AGG(participantName) as participantName,
STRING_AGG(stepDefinitionName) as stepDefinitionName
FROM public.participations
GROUP BY id, participantId, activityId
Got it, thank you so much for your help @RusovDmitriy.
Problem
How can I use another dimension for display?
Related Cube.js schema
Cube.js JSON query
I'm wondering if there is a way to select the
participantName
andactivityName
instead ofparticipantId
andactivityId
. In other words useparticipantId
andactivityId
for grouping and use others for display purpose.Thanks