Forum Discussion
Merging issue where a line gets doubled when pulling in field from merged query
- 1 year ago
Hi rpinxt ,
Since your keys are matching for all rows you get more than one line for each one:
When you expand you get two rows. In this case you need to select the aggregation and not the expansion:
One row per each one
Be carefull on this merge since if there are for the same key more than one Storage type you will only get the maximum, you can also select the minimum or make it in a different way.
Oh my I was not aware of this behavior. Still not sure if I understand why it gives 2 rows when normal expanding. There is only 1 line in the lookup with that key. Or is the timestamp (runtime) the one causing the doubling?
This seems indeed to work. Now hoping it will work on the main file to.
Thanks MFelix
Hi rpinxt ,
There are two rows because on the merge table you have two rows that have the same key so it returns the full match between the other table:
whe you do the merge you are picking up this two rows that have the same value that is why when you expand it you will get the duplicate of the row one for each of the times.
That is visible on my first screenshot on the other post.
Glad it could help.
- rpinxt1 year ago
Solution Sage
Yes you are correct MFelix
And these 2 rows come from the RunTime. For next run you get 3 rows etc.
Your solution worked but unfortunately not for me.
First of this aggregate is really slow as it needs to calculate for every row.
Not that much rows but I could see it going one by one.
And when done it said I could not use this step in directquery.....
So bad luck for me. But it did set me on the correct path.
Having the key every runtime was the problem.
Luckily I not needed runtime on the second source.
It serves merely as a lookup so I only needed the latest version.
So now I overwrite everytime the last version and therefore my key is only in once 😄
Solved my problem!
Thanks again for pointing me in the right direction.
- MFelix1 year ago
Super User
Hi rpinxt
Another option can be to generate an aggregated table that is only use ffor the lookup that will group the keys and return that column value and then merge it with your final table
- rpinxt1 year ago
Solution Sage
Yes could probably also done that. But now I was able to configure the source (removing the column with the timestamps). So no extra steps in query editor.