Mahmoud is having way too much TSQL Fun (Pivot Function) – Analytical Accounting Dimensions.
Dynamics GP Essentials: TSQL Fun (Pivot Function) – Analytical Accounting Dimensions
General Ledger & FinancialsSQL & Data
Archived post from 2014. Dynamics GP and the links it points to have changed since; check current documentation before relying on version-specific steps.