Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Database design and modeling

Hi, 
I want to create a dashboard where I would have a matrix with the categories divided per date and its chart per date and value.
For example, I would have a table with the countries, then I would find the cities, and then the division per indicators. 


I have two options. In the first table, I have in the first column the date and the next columns the values for Country/City/Indicator combination. I will have many combinations and I want to have all the values from all the year in the table. 

 

CountryMexicoMexicoUSAUSA
CityCdmxCdmxNYCNYC
IndicatorPeopleQualityPeopleQuality
01-01-221001015010
02-01-222002025020
03-01-223001035010
04-01-224002045020
05-01-225001055010
06-01-226002065020
07-01-227001075010
08-01-228002085020

Vertical


In the second option, I have the categories in columns (country, city, indicator) and one date per column.

CountryCityIndicator01-01-2202-01-2203-01-2204-01-2205-01-2206-01-2207-01-2208-01-22
MexicoCdmxPeople100200300400500600700800
MexicoCdmxQuality1020102010201020
USANYCPeople150250350450550650750850
USANYCQuality1020102010201020

Horizontal

 

Which database design should I use in order to have the dates- country/city/indicator matrix table?

How can I create the data model in order to use a matrix chart?

I hope you can help me to solve this issue. Thank you.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    The second one. Open query editor and selecte the first three columns and use unpivot other columns feature.

    Then you will get a table like below and you will be able to create matrix the visual that you wanted.

     

    Best Regards,

    Jay

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    The second one. Open query editor and selecte the first three columns and use unpivot other columns feature.

    Then you will get a table like below and you will be able to create matrix the visual that you wanted.

     

    Best Regards,

    Jay

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you. I didn't know that feature, it is really helpful