Join our Community in its new Home - The Datorama Trailblazer Community Group!
It's been an amazing 3 years coming together in this forum to collaborate, innovate, support, and inspire each other about our shared usage of Datorama. While this is not quite a goodbye, we are excited to announce that we are getting a fresh start in our new home within the Salesforce Trailblazer Community. We have a ton of fun new content planned and you may even see the revival of some of our most popular posts from the past few years.
We’ll be keeping this group around for a bit for you to peruse, but as of November 15, we will no longer be allowing new posts or comments. Be sure to join our new group at https://www.salesforce.com/success-datorama to keep the conversation going.
We can’t wait to see you there!
It's been an amazing 3 years coming together in this forum to collaborate, innovate, support, and inspire each other about our shared usage of Datorama. While this is not quite a goodbye, we are excited to announce that we are getting a fresh start in our new home within the Salesforce Trailblazer Community. We have a ton of fun new content planned and you may even see the revival of some of our most popular posts from the past few years.
We’ll be keeping this group around for a bit for you to peruse, but as of November 15, we will no longer be allowing new posts or comments. Be sure to join our new group at https://www.salesforce.com/success-datorama to keep the conversation going.
We can’t wait to see you there!
Distinct Count of Dimension


in Help Center
Hi,
I'm trying to create a Status Bar Widget with the measurement "Number of Orders". My data is on a transactional level therefore an Order No can appear more than once. I want to create a calculated measurement that does a distinct count of Order No so that I'm able to display how many orders there is as well as how many transactions there is.
I have tried a couple of things in Calculated Measurements but have been unsuccessful.
Find attached an example of the data stream.
Any help to create this view will be much appreciated!
Mareets
Any help to create this view will be much appreciated!
Mareets
Comments
I also am experiencing difficulty getting the DISTINCTCOUNT and COUNTDISTINCT functions to work as one might expect them to. They would seem to work right up until they were put into a widget, then the "no data" message is displayed for reasons I don't understand (though if I add additional metrics to the widget, the distinctcount metric will display correctly, this can be seen via table widget).
That being said, I did find an alternative solution. First, in the mapping, I created a dummy metric that simply has "1" as the formula. Next, after creating the data stream, make the following calculated metric:
COUNT([dummy_metric], [[Order_No]])
Set both the Total Aggregation Function and Aggregation Function to "Count". Then throw this into a Status Bar widget and that should be it. I find that this calculated metric returns the desired "6" value for your data set (6 distinct order #s) in the status bar widget.
Hopefully there's a better/smarter solution out there, one that allows for use of DISTINCTCOUNT or COUNTDISTINCT.
Mike
As far as I understand, when you insert the calculated measurement that has only the DISTINCTCOUNT(dimension) function, you are getting the following output:
If that is the case, the simplest solution is to add and subtract a relevant mapped measurement in the syntax.
For example:
The reason for this behavior is that it is not possible to visualize dimension only queries. Adding and subtracting a mapped measurement, "grounds" the query.
Let me know if you need anything else
Kind regards,
Aleks