Skip to content
Advertisement

Dynamic bit-based flattening of multiple rows by pivoting into additional columns

I have data that looks like this:

And I would like it to look like this:

I think a dynamic conditional aggregation is required. Any help would be appreciated.

Advertisement

Answer

Here is a sample implementation of dynamic conditional aggregation:

this is the result:

enter image description here

Now you can add a value (for example id = 4 and value = ‘e’) replacing the original insert with this one:

this is the new output:

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement