Forum Discussion
Pivot rows to columns with multiple values
Hi,
I want to pivot the "charge_name" column shown below with 10+ catagories:
I need to pivot using two value fields, qty and amount respectively:
Here's how I did it: I duplicated the charge name column and pivoted the columns using amount and quantity respectively.
I also had to change the pivoted column names otherwise i would get duplicate error when I do quantity.
Is there a better/smarter way to do this?
Any suggestion appreciated,
Thanks!
2 Replies
- EhrenMicrosoft Employee
There may be a better way, but your approach is probably the one I would have taken.
- AnonymousNot applicable
bestbestb
I don't know your solution step by step so it is hard to say. I cannot think of any better without any test. If you already have a solution, should stick with it. Simple pivot and unpivot steps would not slow the query speed.Paul Zheng _ Community Support Team