Pulling fields based on TranType

I have a BAQ that reports costs on PO’s based on TranType. Currently I have 4 BAQ’s to report on: PUR-UKN, PUR-STK, PUR-MTL and PUR-SUB.

I would like to combine these BAQ’s into one BAQ. I know I can add a parameter that asks the user which trantype they want to run.

My question is…once the trantype is chosen how do I tie it to the subquery(?) that pulls the fields that I need to report on.

I found if I add all the fields I want to use to the main BAQ it skews my report and doesn’t report the PO’s correctly for each of the trantypes.

Please let me know what you might need to understand my question more thoroughly.

Thank you!

Judy, do you mind sharing your BAQ?

Assuming that the BAQs are identical except for the trantype.

Wherever you have trantype = ‘PUR-XXX’ in the BAQ you just use the parameter.

1 Like

Attached is an Excel Worksheet with the 4 BAQ’s compared against each other. Some lines I have deleted as they are identical across each BAQ.

Items highlighted in RED are what makes each trantype unique:

BAQ.xlsx (9.9 KB)

Please note that the first row depicts each TranType.

Are you able to show the BAQs? That will help you get to a solution.

If your top level query is already filtered by your parameter and the sub queries are joined on an inner join to the top level query, then they should already be filtered by your parameter too.

1 Like

Sorry it took so long to reply! I will look into doing this. I never thought about this in quite that way. Let me do some rearranging and I’ll let you know what I come up with.

Thank you so much!