cancel
Showing results for 
Search instead for 
Did you mean: 
Community_Admin
Community Team Member
Community Team Member

Question:

How can I use the date in the Pivot values?

Answer:

You can follow these steps:
1. Convert the date into an Integer with this chunk of SQL:
GETYEAR([Date])*10000
+GETMONTH([Date])*100
+GETDAY([Date])
 
2. After you have an Integer representation of a date in the cell use some Jquery to format it the way you want. Using this in the "Edit Script" section:
widget.on('ready', function(){
     $("div.table-grid__tbody div.table-grid__content__inner").map(function(i, cell) {

          var input = cell.innerHTML.replace(/(\d\d\d\d)(\d\d)(\d\d)/, "$2/$3/$1");
          // console.log('input');
          // console.log(input);

          cell.innerHTML = input;
     });
});
 

 

Rate this article:
Version history
Last update:
‎10-14-2021 04:08 PM
Updated by:
Contributors