Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kikko
Contributor II
Contributor II

calc condition message

Goodevening all,

hope someone can help on this!

I'm using visualization API to show a KPI object into my mashup.

This is my code:

//ranking parts 
	app.visualization.create( 
	'kpi',
	  [
		{
      "qDef": {
        "qLabel": "Parts",
        "qDef": "RankingParts.Ranking",
        "qNumFormat": {
		"qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "0°",
          "qDec": ".",
          "qThou": ","
          
        },
		"conditionalColoring": {
          "useConditionalColoring": true,
          "segments": {
            "limits": [
              {
                "value": {
                  "qValueExpression": {
                    "qExpr": "RankingParts_Prev.Ranking-0.001"
                  }
                },
                "gradient": false
              },
			  {
                "value": {
                  "qValueExpression": {
                    "qExpr": "RankingParts_Prev.Ranking+0.001"
                  }
                },
                "gradient": false
              }
            ],
            "paletteColors": [
              {
                "color": "#04912b",
                "icon": "R",
                "index": -1
              },
			  {
                "color": "#fc9003",
                "icon": "T",
                "index": -1
              },
              {
                "color": "#db1f12",
                "icon": "S",
                "index": -1
              }
            ]
          }
        }
      },
	  "qCalcCondition": { "qCond": "=(not(isnull([RankingParts.Ranking])) or not(isnull([RankingParts_Prev.Ranking])))", 
	  					  "qMsg": "Error Message"
    } 
    },
	{
      "qDef": {
        "qLabelExpression": "upper(Label_Prev_Short)",
        "qDef": "RankingParts_Prev.Ranking",
        "qNumFormat": {
          "qType": "F",
          "qnDec": 2,
          "qUseThou": 0,
          "qFmt": "0°",
          "qDec": ".",
          "qThou": ","
        },
        "conditionalColoring": {
          "paletteSingleColor": {
            "index": -1,
            "color": "#5c5b5b"
          }
        }
      }
    }
	  ],
	  {
	  "showTitles": false,
	  "showMeasureTitle": true,
	  "textAlign": "center",
	  "fontSize": "L"
	}
	).then(function(vis){
	  vis.show("parts_rank");//ranking parts
});

 

Ok the object works correctly, but I want the object to display an error message when the KPIs are "null".  The calcultion condition is working fine but when it is false I can't see the message. What I see is a blank "DIV".

Can someone help me to understand what I'm writing wrong or if I need to insert other specific keywords to let the object to show my message?

thank you

Federico

0 Replies