cancel
Showing results for 
Search instead for 
Did you mean: 

Reorder columns in pivot table

gyanianand
8 - Cloud Apps
8 - Cloud Apps

Hi Team,@Angelina_QBeeQ

I want to order the weeks displayed in below pivot in desc order i.e latest week first and so on.

Also how to hide the "Header" word....i need the column but the column header should be blank.

Please help !!

gyanianand_0-1684134616028.png

 

1 ACCEPTED SOLUTION

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @gyanianand ,
If you want to reorder rows/columns, use the script below:

widget.on('buildquery', function (se, ev) {
	ev.query.metadata[3].jaql["sort"] = "desc"; // [3] add here the index of your query
});

The sample with result and query index here:

Angelina_QBeeQ_0-1684230686412.png

To hide the column header, you can change the cell value:

widget.transformPivot(
	{},
  function (metadata, cell) {
    if (metadata.colIndex == 0 && metadata.rowIndex == 0) {
      cell.content = ' '
    }
  }
);

Always here to help,
Angelina from QBeeQ
[email protected]
QBeeQ  - Gold Implementation and Development Partner

View solution in original post

3 REPLIES 3

Angelina_QBeeQ
10 - ETL
10 - ETL

Hi @gyanianand ,
If you want to reorder rows/columns, use the script below:

widget.on('buildquery', function (se, ev) {
	ev.query.metadata[3].jaql["sort"] = "desc"; // [3] add here the index of your query
});

The sample with result and query index here:

Angelina_QBeeQ_0-1684230686412.png

To hide the column header, you can change the cell value:

widget.transformPivot(
	{},
  function (metadata, cell) {
    if (metadata.colIndex == 0 && metadata.rowIndex == 0) {
      cell.content = ' '
    }
  }
);

Always here to help,
Angelina from QBeeQ
[email protected]
QBeeQ  - Gold Implementation and Development Partner

Thanks a lot for this help Angelina!!

Gannon
9 - Travel Pro
9 - Travel Pro

@Angelina_QBeeQ if this was a text field, how would you sort the columns by "Low", "Medium", "High"?

Ascending or Descending won't work in this scenario, but I can't find references in the JAQL documentation.

Any help would be greatly appreciated.