Forum Discussion

Ross_PBI's avatar
Ross_PBI
Frequent Visitor
6 years ago

Merge Queries - Add column from query 2 or query 3 based on col;umn value in query 1

I need to add three columns from query 2 or query 3 to my query 1 based on the value in a column in query 1

So for example say my query 1 has a column, with the values A or B within it

I need to add three columns to query 1 and take the values for these columns from query 2 if my column has a value A or from query 3 if my column has value B

Can i do this in one go?

At the moment I am using merge queries on my column twice which adds six columns. I then created three more columns with logic to grab the figures from the first or second three columns. Then delete the excess. Not efficient but working

2 Replies