Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello boys and girls,
What I'm trying to do is show the amount of stores that are selected out of all the stores present.
There are 100 Stores and I've selected 20 of them so my result should be 20 / 100
This is my expression but the value on the left is the same as the value on the right:
=COUNT(Distinct(Store_ID)) & ' / ' & COUNT(Distinct(Store_ID))
Does anyone know how to fix this please?
Kind regards,
Monique
I had thought you could use the inbuilt functions something like this:
=GetSelectedCount(Store_ID)&' / '&(GetSelectedCount(Store_ID)+GetNotSelectedCount(Store_ID))
But I am not sure GetNotSelectedCount works quite as I expected.
Vineeth's example is great but will only exclude Store_ID in the 'possible' number
You might want to use this to make sure the right hand number is regardless of any selections
COUNT(Distinct(Store_ID)) &' / ' & COUNT({1}Distinct(Store_ID))
Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.
=COUNT(Distinct(Store_ID)) &' / ' & COUNT({<Store_ID>}Distinct(Store_ID))
Hi,
Try below
1: COUNT(Distinct(Store_ID)) & ' / ' & COUNT(Total Store_ID)
2: COUNT(Distinct(Store_ID)) & ' / ' & COUNT({1}Store_ID)
Regards,
I had thought you could use the inbuilt functions something like this:
=GetSelectedCount(Store_ID)&' / '&(GetSelectedCount(Store_ID)+GetNotSelectedCount(Store_ID))
But I am not sure GetNotSelectedCount works quite as I expected.
Vineeth's example is great but will only exclude Store_ID in the 'possible' number
You might want to use this to make sure the right hand number is regardless of any selections
COUNT(Distinct(Store_ID)) &' / ' & COUNT({1}Distinct(Store_ID))
Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.
Try this
GetSelectedCount(Store_ID) / Count(ALL Distinct Store_ID)
or
GetSelectedCount(Store_ID) / Count({1} Distinct Store_ID)
Both works same.
Hi,
Try
=GetSelectedCount(Store_ID) & ' / ' & COUNT(Distinct Store_ID)
Hope this helps you.
Regards,
jagan.
For % of selected:
COUNT(Distinct(Store_ID)) & ' / ' & COUNT({1} Total Distinct(Store_ID))
For % of non selected
COUNT({1-$} Distinct(Store_ID)) & ' / ' & COUNT({1} Total Distinct(Store_ID))
Regards!
Distinct is not a function, so there is no need for the brackets. The total number of store in your loaded data can be aggregated by using the ALL qualifier or a set expression that deselects all your selections.
COUNT( ALL DISTINCT Store_ID)
COUNT( {1} DISTINCT Store_ID)
The complete expression would then be: COUNT(DISTINCT Store_ID) & ' / ' & COUNT( ALL DISTINCT Store_ID)
If a selection in an other field than Store_ID excludes a Store_ID, then this solution will not give all the Store_ID that was loaded into the data model.
TOTAL is most likely not the accurate choice here, as it will only span over the values within the current selection. In a chart it would mean that the dimension is ignored and aggregation is done over the entire data set.
ALL is equal to the set expression {1}