I am interested in finding a way to transform data from a denormalized table with a structure like the following:
item id | metric a | metric b
1 100 50
2 30 75
To a new key-value format like the following:
item id | metric name | metric value
1 metric a 100
1 metric b 50
2 metric a 30
2 metric b 75
I can see how to transform from key-value to denormalized using a CASE/DECODE style approach; however, I don't see how to "unpivot" data like in the example above. Is there a Vertica built-in function to do this? If not, has anyone been able to do this using a "pure SQL" approach?
Thanks in advance,
Dave
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.