Migration Center Results Questions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Zurich Patch 0
We recently ran a bulk migration and are reviewing the results in the Migration Center. We have not activated the migrated content.
We have the following questions:
- Why are single scores shown in decimal format in some migrated reports? For example, if the score is 77 on the Core UI report, the migrated report shows it as 77.00 . This doesn't seem to be the case for all migrated single score reports; some are matching the format in the Core UI version and some are showing in decimal format.
- When comparing the migration results to the Core UI versions in the Migration Center should drilldowns work? That is, in the migrated version of a single score report should I be able to drill down to the list of records in preview mode (for reports that have drilldown enabled in the Core UI version)?
- For chart reports, it appears that the values are rounded to whole numbers in the migrated version when they show as decimal in the Core UI version. For example, a pie chart report in Core UI shows category false=148 (86.05%) and true=24 (13.95%) but the migrated version shows false 148 86% and true 24 (14%). Why doesn't the migrated report match the format of the Core UI report?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I have seen this behaviour also.
We are currently preparing for a migration and after doing test run, we noticed the extra decimals in the PA view.
I'm glad to know its not just us.
Out of curiosity have you just upgraded from Yokohama or Xanadu?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
We upgraded from Yokohama to Zurich Patch 0. We also updated Platform Analytics related plugins.
If we update our Core UI single score reports and change decimal position to 0 from 2 under value formatting prior to migrating, the migrated single score reports display the score as a whole number.
Note also that it is my experience that the following is not true:
All links and navigation menu items are redirected to the PAe version of the content upon Activation in the Migration Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
I've been playing with this with @Shawn Smith1 on our instance, and got what I think is a working script, it'll go through all the JSON of the widgets and update them to 0 decimal places.
After running it you might need to clear your instance cache. It seems quite inconsistent in that sometimes updating the JSON won't update the dashboard, but it's the best we've come up with for now.
// Update decimalPrecision: 2 -> 0
(function () {
var DRY_RUN = false; // set to false to save changes
var gr = new GlideRecord('par_visualization');
gr.addEncodedQuery('active=true^macroponent=d24d53f60350de7a652caf3188a46ed2^propertiesLIKE"decimalPrecision": 2^ORpropertiesLIKE"decimalPrecision":2');
gr.query();
var gr2 = new GlideRecord('par_dashboard_widget');
gr2.addEncodedQuery('component=d24d53f60350de7a652caf3188a46ed2^component_propsLIKE"decimalPrecision": 2^ORcomponent_propsLIKE"decimalPrecision":2');
gr2.query();
while (gr.next()) {
var sysId = gr.getUniqueValue();
var raw = gr.getValue('properties');
if (!raw) continue;
try {
var obj = JSON.parse(raw);
var changed = replaceDecimalPrecision(obj);
if (changed) {
if (!DRY_RUN) {
gr.setValue('properties', JSON.stringify(obj));
gr.update();
}
gs.info('[par_visualization] Updated sys_id=' + sysId);
}
}
catch (e) {
gs.error('[par_visualization] JSON parse error on ' + sysId + ': ' + e.message);
}
}
while (gr2.next()) {
var sysId2 = gr2.getUniqueValue();
var raw2 = gr2.getValue('component_props');
if (!raw2) continue;
try {
var obj2 = JSON.parse(raw2);
var changed2 = replaceDecimalPrecision(obj2);
if (changed2) {
if (!DRY_RUN) {
gr2.setValue('component_props', JSON.stringify(obj2));
gr2.update();
}
gs.info('[par_visualization] Updated sys_id=' + sysId2);
}
}
catch (e) {
gs.error('[par_dashboard_widget] JSON parse error on ' + sysId2 + ': ' + e.message);
}
}
// Recursively set any "decimalPrecision": 2 (number, "2", or "2.0") to 0
function replaceDecimalPrecision(node) {
var modified = false;
if (Array.isArray(node)) {
for (var i = 0; i < node.length; i++) if (replaceDecimalPrecision(node[i])) modified = true;
return modified;
}
if (node && typeof node === 'object') {
for (var key in node) {
if (!Object.prototype.hasOwnProperty.call(node, key)) continue;
if (key === 'decimalPrecision') {
var v = node[key];
var isTwo = (v === 2) || (v === '2') || (v === 2.0) ||
(typeof v === 'string' && String(parseFloat(v)) === '2');
if (isTwo) {
node[key] = 0;
modified = true;
continue;
}
}
if (replaceDecimalPrecision(node[key])) modified = true;
}
}
return modified;
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a week ago
Thank you!
Not sure that we want to do this for all single score reports. It depends on the aggregation. If the aggregation is average, we want that displayed in decimal format; if it's a count or distinct count, we want that displayed as a whole number.
It seems that with Core UI reports, it displayed the score using a format that made "sense" for the aggregation. That is, even though under value formatting, decimal precision defaults to 2, the score for a count aggregation was displayed as a whole number; the score for an average aggregation was displayed as a decimal number. Not sure why Core UI reports seems to ignore the value formatting unless I'm missing some property or setting for this.