Skip to main content
Skip table of contents

How to pivot a PocketQuery result table (transpose, juxtapose)

Example

This table:

a

b

c

d

e

f

g

h

i

Should become this:

a

d

g

b

e

h

c

f

i

How To

  1. Go to the PocketQuery Administration

  2. Go to "Templates" and click on "Add template"

  3. Name it "pivot" and copy & paste following code into "content"

    CODE
    <table class="aui confluenceTable pocketquery-table">
        <tbody>
        #foreach ($column in $columns)
            <tr>
                <td style="background-color: #f0f0f0; font-weight: bold;">
                    $column
                </td>
                #foreach($row in $result)
                    <td>
                        $!row.get($column)
                    </td>
                #end
            </tr>
        #end
        </tbody>
    </table>
  4. Go to a query and select "pivot" as template

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.