How to Use a Field for Calculations in Amazon Q Without Displaying It in Responses?

"In Amazon Q, I need to calculate the unique count of UserId, but I don’t want this field to be displayed in responses or visuals when users interact with Q. I want Q to use UserId internally for calculations while keeping it hidden from user queries

If I include UserId calculation are correct but, if I remove it calculations are based on unique count of Full name. There are cases when multiple users have same Full name

What is the best way to achieve this within a Q topic? Are there any settings or configurations that allow a field to be referenced for calculations but not exposed in responses?

Hi @AjayV,
When you say that you don’t want the UserID to be displayed…for example, are you referring to the table on the right that has ‘UserID’ as a column?

Q will always incorporate the fields required to answer your question within your visuals, unfortunately, there are still limitations to how you can edit the visuals returned, unfortunately hiding a column is not one of those options.

If you’re just looking to incorporate the distinct count numbers, not the actual ID’s; one work around that may work for your scenario:

  • Create a calculated field to find the distinct count of your user ID’s. That way, when asking a question that’s linked to your calculated field, it should use that field to populate your count. I do not have similar data to test though so I am unsure if it will still include UserID or not so you’ll have to test out.

Additionally, another work around option you could test out: create a filter for your UserID but there is an option you can set that filters out the information ‘unless a question results in an explicit filter from dataset’:

image

Let me know if one of these options solve as a work around for your case. If not, let me know and I can mark this as a feature request.

Thank you!

@Brett I tried using both the solution, but not able to hide field without Excluding from dataset, So I am using Email Id currently. Can you please add it as feature request.

Hi @AjayV,
Yes, I’ll mark as a feature request.