I’ve searched a few times and i’ve been unable to find a good method of dynamically setting the output columns within a reverse pivot group… for a project, we currently receive a list of field changes from an audit table in the following format:
row_id, account_num, field changed, new amount, old amount, date_changed
1, 555, ‘phone_num’, ‘555-5555’, ‘555-5556’, 3/31/2012
2, 555, ‘address2’, ‘apt 3’, ‘apt 4b’, 3/31/2012
…
i’m looking for a way to un-pivot these to allow map operations like the table below:
operation, account_num, phone num, address2, date changed
‘update’, 555, ‘555-5556’, ‘apt 4b’, 3/31/2012
(‘update’ will be static for each row)
currently, we’re using sql server '05 and BODS 14.0…
i’ve seen suggestions in the past on using a running number in each group… but i cant get the gen_row_num_by_group to work while keeping the ‘field_changed’ consistent for each change in the target.
any ideas where im going wrong?
we have over 83 fields that we’re looking to update, with more to be sporadically added in the future…
ww55d (BOB member since 2011-06-14)