Forum Discussion
Summing up counts in a table
| Country | Status |
| Asia | RED |
| Japan | GREEN |
| China | RED |
| Korea | YELLOW |
To
| Country | Count of Red | Count of YELLOW | Count of GReen |
| Asia | 5 | 7 | 8 |
| Japan | 1 | ||
| China | 1 | ||
| Korea | 1 |
Hi all,
currently I am using a code that switches when a metric changes, so if the condition is at 1, it will be green, 2 yellow, red 3. (1st table)
Hi WestWinter
Use a Matrix in your report and add Status column to Columns and values [in Values set a aggregation to Count] and add Continent and Conuntry columns to the Rows, like this:
Data I Used:
Output:
Did I answer your question? Mark my post as a solution!
Appreciate your Kudos !!
5 Replies
- VahidDM
Super User
Hi WestWinter
Use a Matrix in your report and add Status column to Columns and values [in Values set a aggregation to Count] and add Continent and Conuntry columns to the Rows, like this:
Data I Used:
Output:
Did I answer your question? Mark my post as a solution!
Appreciate your Kudos !!
- v-henryk-mstf
Community Support
Hi WestWinter ,
I think the solution provided by VahidDM is effective.
Or you can try the resume dimension table and the fact table, the table relationship is connected according to the country, and the one-to-many relationship. Then construct a similar matrix visual table.
If the problem is still not resolved, please point it out. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - Jos_Woolley
Solution Sage
Hi,
It's not clear from the data you've posted how your continents are stored? "Asia", for example, is not a country, though in the table you give it appears under that heading.
I presume you have a simple dimension table which contains each Country together with its associated Continent?
Regards
- WestWinter
Helper II
Jos_Woolley That is correct
- Jos_Woolley
Solution Sage
So your second table is your expected results? So you want 3 separate measures - Count of Red, Count of Yellow, Count of Green - which at the Country level provide simple counts but at the Continent level provide different results? Can you explain how you arrive at a result of 5 for Count of Red|Asia?
I think a much clearer example dataset together with expected results would be beneficial.
Regards