Forum Discussion

tsaho8's avatar
tsaho8
Cloud Apps
04-12-2023
Solved

Change sorting order of date filed in pivot column

Hi Angelina_QBeeQ ,

Could you please assist me how to sort date field from column section in pivot table. I want the latest month first and so on. 

 

  • Hi tsaho8 ,

    The following script could work for your case. 
    Depending on the number of rows and columns, you might have to tweak the index number it to make it work. 
    Assuming a simple pivot table, with just one row dimension and one column dimension:

    widget.on("buildquery", function(se,ev) {
    	ev.query.metadata[1].jaql["sort"]="desc";
    })

     

    Please let me know if this works for you : )

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

1 Reply

Replies have been turned off for this discussion
  • Hi tsaho8 ,

    The following script could work for your case. 
    Depending on the number of rows and columns, you might have to tweak the index number it to make it work. 
    Assuming a simple pivot table, with just one row dimension and one column dimension:

    widget.on("buildquery", function(se,ev) {
    	ev.query.metadata[1].jaql["sort"]="desc";
    })

     

    Please let me know if this works for you : )

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