This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
So just to clarify, you'd like each Charge type number to have its own column? i.e. A transaction using A-123 will never be in the same column as K-789?
Or are you looking to generate additional columns for every transaction, with the total number of columns proportional to the ID which has the most transactions associated with it?
In this second case, You'd want the ChargeType1 and ChargeAmt1 to be K-789 and 123.56 respectively, with ChargeType/Amt2 and ChargeType/Amt3 being Null(), correct?
I'm working on getting an example up, but if you could clarify this last thing it would help,
EDIT: Here's a screenshot of what something like the first case would look like, which is what it appears to me that your desired output is. It appears that each ChargeType column would only ever have values with the same ChargeType, so instead I've make these ChargeTypes the headers. That being said, this would fail if there were more than 1 transaction of each type for a given ID. The way I've currently got it set up is that it would sum those, and I doubt that is what you'd be looking for.
Yes, I wanted to generate columns for every transaction with the total number of columns proportional to the ID. So for some orders few columns could be empty as they might not have values.
You'd want the ChargeType1 and ChargeAmt1 to be K-789 and 123.56 respectively, with ChargeType/Amt2 and ChargeType/Amt3 being Null(), correct? ---> Yes, since Ord#2026 does not have any values associated with ChargeType1 and ChargeType2.