Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an issue with two tables of data which contain field values for a list of items (services in this case).
The first table contains the current live values of each field, while the second table contains the historical values prior to each update.
My goal is to use the data from both tables so I can identify when changes were made and the corresponding value changes.
Below are examples of how the tables appear currently:
Live Data
Service_ID | Service_Version_ID | Service_Colour | Date |
---|---|---|---|
461987 | 109082 | Blue | 07-Aug-2015 |
723145 | 607288 | Yellow | 03-Aug-2015 |
998422 | 723811 | Green | 04-Aug-2015 |
Historical Data
Service_ID | Service_VersionHist_ID | Service_HistColour | HistDate |
---|---|---|---|
461987 | 107334 | Red | 25-Jun-2015 |
461987 | 105969 | White | 14-May-2015 |
723145 | 605844 | Blue | 17-Jul-2015 |
723145 | 605118 | Yellow | 09-Jul-2015 |
998422 | 711865 | White | 04-Mar-2015 |
998422 | 709453 | Blue | 23-Feb-2015 |
What I am trying to get is a view where I can map the historical fields with the corresponding live fields (Version_ID, Service_Colour, Date).
My goal is to then be able to use a global calendar to filter for colour changes over periods of time. I.e. Identify the previous Service_Colour for each Service_ID and the date on which it was implemented.
I had tried to do this is a different way using mapping but did not get the required output.
Does anyone have an idea on the most effective way to do this?
Thanks very much.
Thanks both.
This worked nicely to add the history data as new rows in the master table.
I encounter an issue with one of my datasets however, where the Live Data table has some additional fields which are are not in the Historical Data table.
As a result they return null values for the historical entries, whereas I would like them to return the same value that is in the live table. These are fixed values which do not get updated, so showing the live vlaue would be all I need.
Is mapping the best solution to resolve this, before concatenation?
It's a solution.
Another could be to add a table with these fixed values fields and link this new table with the fact table by Service_ID (or some other fields).
We (community) have a partial view of your model , requirements, etc, ...... We can try to give different solutions, it's hard to say which is the best.
Hi,
I suggest you post sample data
Hi Gabriel,
Attached is a basic version with mapping used to add any extra fields.
This is ok in the instance where I only map a couple of fields, but I'm aware the way it's done may not be the most efficient of mapping multiple fields.
Thanks for all your help. This has pretty much resolved the problem.