<?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 Deneb Vega-lite: AND/OR logic in Custom Visuals Development Discussion</title>
    <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3066964#M6814</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a control chart (see below) which I want to set a conditional color "red" if the Diameter is above or below required limits, "Diameter LSL" or "Diameter USL". If within limits "darkblue"-&lt;BR /&gt;&lt;BR /&gt;I struggle to find the correct syntax in Deneb to add AND/OR statements to the condition test.&lt;BR /&gt;if ((Diameter &amp;gt; Diameter USL) OR (Diameter &amp;lt; Diameter LSL))...&lt;BR /&gt;&lt;BR /&gt;How can I modify the code below (or is it an better way to achieve the results I want?) to also set the mark below Diameter LSL to "red"?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt; },
          "encoding": {
            "color": {
	            "condition": {
	              "test":  "datum['Diameter'] &amp;gt; datum['Diameter USL']", "value": "red"
                     },
	              "value": "darkblue"
	    },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 388px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/867839iD5D7E36DCCC45F4C/image-dimensions/388x209?v=v2" width="388" height="209" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Feb 2023 19:24:16 GMT</pubDate>
    <dc:creator>Salle</dc:creator>
    <dc:date>2023-02-07T19:24:16Z</dc:date>
    <item>
      <title>Deneb Vega-lite: AND/OR logic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3066964#M6814</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a control chart (see below) which I want to set a conditional color "red" if the Diameter is above or below required limits, "Diameter LSL" or "Diameter USL". If within limits "darkblue"-&lt;BR /&gt;&lt;BR /&gt;I struggle to find the correct syntax in Deneb to add AND/OR statements to the condition test.&lt;BR /&gt;if ((Diameter &amp;gt; Diameter USL) OR (Diameter &amp;lt; Diameter LSL))...&lt;BR /&gt;&lt;BR /&gt;How can I modify the code below (or is it an better way to achieve the results I want?) to also set the mark below Diameter LSL to "red"?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt; },
          "encoding": {
            "color": {
	            "condition": {
	              "test":  "datum['Diameter'] &amp;gt; datum['Diameter USL']", "value": "red"
                     },
	              "value": "darkblue"
	    },
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 388px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/867839iD5D7E36DCCC45F4C/image-dimensions/388x209?v=v2" width="388" height="209" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 19:24:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3066964#M6814</guid>
      <dc:creator>Salle</dc:creator>
      <dc:date>2023-02-07T19:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb Vega-lite: AND/OR logic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3067117#M6822</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/511107"&gt;@Salle&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You can use JavaScript &lt;A href="https://vega.github.io/vega/docs/expressions/#:~:text=All%20basic%20arithmetic%2C%20logical%20and%20property%20access%20expressions%20are%20supported" target="_self"&gt;logical operators in expressions&lt;/A&gt;, so something like the following will work:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"test":  "datum['Diameter'] &amp;gt; datum['Diameter USL'] || datum['Diameter'] &amp;lt; datum['Diameter LSL']"&lt;/LI-CODE&gt;
&lt;UL&gt;
&lt;LI&gt;And: &lt;FONT face="courier new,courier"&gt;&amp;amp;&amp;amp;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;Or: &lt;FONT face="courier new,courier"&gt;||&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;Not equal: &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you're using the &lt;A href="https://vega.github.io/vega-lite/docs/predicate.html" target="_self"&gt;predicate approach&lt;/A&gt; (using more structured objects rather than expressions), you can use 'predicate composition' to combine these using arrays - &lt;A href="https://vega.github.io/vega-lite/docs/predicate.html#composition" target="_self"&gt;there's an example at the bottom of the doc page here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Hopefully this will help get you moving. Good luck!&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:34:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3067117#M6822</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2023-02-07T20:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Deneb Vega-lite: AND/OR logic</title>
      <link>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3067145#M6823</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;, I did try using your suggestion with | | before but got error message. I guess it was related to wrong placing of " " because now it works perfectly. Thanks again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, great job with Deneb! I am just scratching the surface since a couple of days and really like what I seen so far!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 20:45:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Deneb-Vega-lite-AND-OR-logic/m-p/3067145#M6823</guid>
      <dc:creator>Salle</dc:creator>
      <dc:date>2023-02-07T20:45:43Z</dc:date>
    </item>
  </channel>
</rss>

