Forum Discussion
Mapping columns headings to rows in another table
Hello.
I am trying to link a relationship between 1) column headers in table 1 and 2) Column in table 2. For example:
Table 1:
| Date | A | B | C | D | E |
| 4/20/2020 | 1.98 | 9.41 | 1.57 | 14.32 | 3.02 |
| 4/17/2020 | 1.92 | 8.98 | 1.57 | 14.20 | 3.10 |
| 4/16/2020 | 1.89 | 8.74 | 1.53 | 14.12 | 3.06 |
| 4/15/2020 | 1.88 | 8.80 | 1.50 | 14.10 | 3.03 |
| 4/14/2020 | 1.90 | 8.80 | 1.48 | 13.98 | 2.98 |
| 4/13/2020 | 1.88 | 8.81 | 1.48 | 13.34 | 2.96 |
| 4/10/2020 | 1.90 | 8.98 | 1.52 | 13.10 | 2.96 |
| 4/9/2020 | 1.92 | 9.14 | 1.50 | 12.82 | 2.95 |
| 4/8/2020 | 1.89 | 8.82 | 1.45 | 12.76 | 2.95 |
| 4/7/2020 | 1.90 | 8.80 | 1.45 | 12.66 | 2.99 |
Table 2:
| Ticker | Company name | Country |
| A | AAA | United States |
| B | BBB | Canada |
| C | CCC | Mexico |
| D | DDD | Brazil |
| E | EEE | Malaysia |
How do i go about building this relationship? This is such that i can create a line graph in based on tickers in Table 1 and slice it by country for example.
Thank you
Anonymous you have to unpivot your first table, in query editor, select date column, right click and then unpivot other columns, it will add attribute and value, and attribute will be your A/B/C...value and now you will able to set the relationship.
I would ❤ Kudos 🙂 if my solution helped. ?
1 Reply
- parry2k
Super User
Anonymous you have to unpivot your first table, in query editor, select date column, right click and then unpivot other columns, it will add attribute and value, and attribute will be your A/B/C...value and now you will able to set the relationship.
I would ❤ Kudos 🙂 if my solution helped. ?