Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I have a table like this:
Office | Region | Order-ID |
A | 1 | 10000 |
A | 1 | 10001 |
B | 1 | 10002 |
B | 1 | 10003 |
B | 1 | 10004 |
A | 2 | 10005 |
C | 2 | 10006 |
C | 2 | 10007 |
C | 2 | 10008 |
A | 3 | 10009 |
A | 3 | 10010 |
B | 3 | 10011 |
B | 4 | 10012 |
B | 4 | 10013 |
C | 4 | 10014 |
C | 4 | 10015 |
C | 4 | 10016 |
C | 4 | 10017 |
I want in to result as such:
Region | Top-Office |
1 | B |
2 | C |
3 | A |
4 | B |
Based on the top number of orders per region. So Office B has the most orders in Region 1 and so on.
I really want this as a dimension though since I want to use it for coloring a map later on and I have better possibilities when I use a dimenson
Correction: For Region 4, it should be Office C
This is the closest I have come to a solution but you can see that for some reason I get these null values in the table: