<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic calc condition message in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/calc-condition-message/m-p/1818574#M15172</link>
    <description>&lt;P&gt;Goodevening all,&lt;/P&gt;&lt;P&gt;hope someone can help on this!&lt;/P&gt;&lt;P&gt;I'm using visualization API to show a KPI object into my mashup.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//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
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok the object works correctly, but I want the object to display an error message when the KPIs are "null".&amp;nbsp; The calcultion condition is working fine but when it is false I can't see the message. What I see is a blank "DIV".&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Federico&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jun 2021 13:40:54 GMT</pubDate>
    <dc:creator>kikko</dc:creator>
    <dc:date>2021-06-29T13:40:54Z</dc:date>
    <item>
      <title>calc condition message</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/calc-condition-message/m-p/1818574#M15172</link>
      <description>&lt;P&gt;Goodevening all,&lt;/P&gt;&lt;P&gt;hope someone can help on this!&lt;/P&gt;&lt;P&gt;I'm using visualization API to show a KPI object into my mashup.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//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
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok the object works correctly, but I want the object to display an error message when the KPIs are "null".&amp;nbsp; The calcultion condition is working fine but when it is false I can't see the message. What I see is a blank "DIV".&lt;/P&gt;&lt;P&gt;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?&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;Federico&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jun 2021 13:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/calc-condition-message/m-p/1818574#M15172</guid>
      <dc:creator>kikko</dc:creator>
      <dc:date>2021-06-29T13:40:54Z</dc:date>
    </item>
  </channel>
</rss>

