Split one row to two

Hi, I have a summary table, one row looks like key1,count1,count2,count3,sum1,sum2,sum3. I want to display it like

key1,‘count’,count1,count2,count3
key1,‘sum’,sum1,sum2,sum3

How can I achieve this?

0 2 223
  • UX
2 REPLIES 2

davidhuang
Participant II

Has anyone any solutions?

First, the purpose of a key value is to ensure that you can’t have multiple rows with the same key. So what you are proposing outright, violates key constraints and wouldn’t be allowed.

What you could do is have a second table that you write to that adds a new row key value. Something like this:

2X_5_5f0d019e881210134809d4ebc52e95a7d7419ac3.png

I do need to say that this is NOT very good data design and will likely cause issues later when you try to use and display this data.

Why is it that the initial summary table is in this format to begin with? e.g.
key1,count1,count2,count3,sum1,sum2,sum3

To prevent later frustration, maybe you can describe what you would like to have happen in the app? Then we can suggest a more appropriate data design.

Top Labels in this Space