Pivot Table BAQ

Is it reasonable to make a pivot table in a BAQ?

The end goal would be a pivot table for a matrix of the parts in BOM’s. The Rows would be the Component Parts, and the Columns the Parent parts. Something like:

Component SK-0001 SK-0002 SK-0003 SK-0004 SK-0005 SK-0006
CB-0001 10 5
CB-0002 10 5
CB-0003 5
CB-0004 10
CB-0005 5 10
HW-0001 1 3 1
HW-0002 2 2
HW-0003 3
PK-0001 20 20 20 20
PK-0002 20
PK-0003 20

The raw data is conveniently stored in one table (PartMtl). And I’d limit the Parent P/N’s.

How can I dynamically build the columns based on user input?
I can find all of the columns the pivot table would need with:

PartMtl.PartNum LIKE <user parameter>

But how to then transpose that from Rows to columns?

Hi Calvin,

If you make that query an inner subquery and then call it as a subquery you can pivot the values.

Unfortunately, you have to predefine the pivoting filters. One workaround I have used to make dynamic pivot tables is exporting the raw data via REST to excel and then doing the pivoting there.

1 Like