Get Free Trial

Color specific values on specific measure

EDGARDO COLON asked on March 6, 2020

We set color to specific value configured in “Measures”.
Report works ok if I predefine 2 Measures where I want to color the second one “v1” (based on the array).

If my user go to Fields->remove the first measure “v0”, then “v1” becomes the new “v0” and my function fails.
How do I retrieve the “v[NNN]” value based on the name of a specific “Measure” so that, instead of setting “[c].v1”, I use something like “[c].MY_MEASURE.value” or something similar?
Here is my code:

function onReportComplete() {
pivot.getData({}, function(result) {
var column = "";
var record = new Array();
var minValue = 0;
var maxValue = 0;
//Get all rows event totals and repeated lines
for (var i = 0; i <; i++) {
if(column !=[i].r0){
column =[i].r0;
//Get only unique rows
record = record.unique();
for (var r = 0; r < record.length; r++) {
minValue = Number.MAX_VALUE;
maxValue = Number.MIN_VALUE;
for (var c = (record.length+1) ; c <; c++) {
if([c].r0 && !isNaN(parseFloat([c].v1)) ){
if(record[r] ==[c].r0 ){
// Here we assume that values evaluated are in "v1" position as there are 2 Measures in the report
// If I take out the first value in "Measures" my value will be in "v0" and logic will fail
// How do I set dinamically the v[n]?
minValue = Math.min(minValue,[c].v1);
maxValue = Math.max(maxValue,[c].v1);
Min[r] = minValue;
Max[r] = maxValue;

Check the images attached.



1 answer

Illia Yatsyshyn Illia Yatsyshyn Flexmonster March 13, 2020

Thank you for contacting us.
It would be useful for our investigation if you could provide additional details about the logic on which the formatting is based. It would allow us recommending the best solution for your case.
We are looking forwards to hearing from you.
Best regards,

Please login or Register to Submit Answer