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

Question:

How to see the latest date in the Pivot?

Answer:

You need to change the date to an integer. Then I used the script in the comments in a previous post, and was able to request results.

Community_Admin_0-1634259092513.png

This is the script we used

var m_names = new Array("Jan", "Feb", "Mar", 
"Apr", "May", "Jun", "Jul", "Aug", "Sep", 
"Oct", "Nov", "Dec");

var dateColumns = [4]; //select the date columns that should be transformed
var num = 0;
var selections = "";

widget.on('ready', function(se, ev){
 $.each(dateColumns, function(index, value){
 num = $("tbody tr:first").children().length - value;
 var e = element;
 var w = widget;
 var d = dashboard;
 $("tbody tr" , e).not('.wrapper, .p-head-content').each(function(){
 var cell = $(this).children().last();
 for (var a = 0; a < num; a++){
 cell = cell.prev();
 }
 var num1 = parseFloat(cell.text().split(',').join(''));

 var Year = Math.floor(num1/10000);
 var Month = Math.floor(Math.floor(num1%10000)/100);
 var Day = Math.floor(num1%100);
 console.log(isNaN(Year));
 if (!isNaN(Year)) {
 var final_date = m_names[Month-1] +"-"+Day + "-" + Year;
 cell.text(final_date);
 } else {
 cell.text('');
 }
 })
 });
});

 

Rate this article:
Version history
Last update:
‎02-13-2024 01:14 PM
Updated by: