You can also use custom SQL to pivot your data, even if you aren't working Excel, text file, Google Sheets, and.pdf data sources. When you use the UNION ALL operator in a custom SQL query, you can take values from distinct columns and put them into a new column.