I want to calculate, for each level, the % of users out of total users. This is my current query: distinctCountOver({user_id}, [{Users in Conversation Levels}], PRE_AGG)/distinctCountOver({user_id}, [], PRE_AGG)
However, when I try to plot a vertical bar chart with Users in Conversation Levels as the x-axis, I get the error “Your calculated field expression contains invalid syntax. Correct the syntax and try again.” with the error code “DISTINCTCOUNTOVER_INVALID_ARGUMENT” even though I was allowed to create that calculated field. What is going on?
Hi Brett, thank you so much for the response. I have actually created the distinctcount calculation already and am looking to get the % of total count. Is there a way to hard-code the total instead? I’m trying: distinctCountOver({user_id}, [{Users in Conversation Levels}], PRE_AGG)/1000 (assuming 1000 is the total), and it’s still giving me a syntax error.
Apologies on the confusion! I believe the error is stemming from the the dimension for your distinctCountOver portion as Quick Sight does not allow you to nest a pre_agg calculation within another.
What if you tried running some of your calculated fields at the dataset layer to try and bypass the error?
Following up here as it’s been awhile since we last heard from you on this thread; are you still working on this issue or were you able to find a work around in the interim?
If we do not hear back within the next 3 business days, I’ll close out this topic.
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community.