<?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 Switch... Case for coloring Sankey chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1628674#M63388</link>
    <description>&lt;P&gt;I have a Sankey chart with a bunch of nodes that I want to assign different colors. I could probably do it in a pinch with nested if statements, but that's an ugly ugly kludge. What I want to do is use a Switch statement like you would in just about any other programming language... like this:&lt;/P&gt;&lt;P&gt;SWITCH&lt;/P&gt;&lt;P&gt;CASE 'A' Red();&lt;/P&gt;&lt;P&gt;CASE 'B' Blue();&lt;/P&gt;&lt;P&gt;CASE 'C' Green();&lt;/P&gt;&lt;P&gt;DEFAULT Black()&lt;/P&gt;&lt;P&gt;END SWITCH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why SWITCH isn't available for color expressions? Or if there's a switch-like statement that I'm not finding?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:00:19 GMT</pubDate>
    <dc:creator>McLaughlinMatt</dc:creator>
    <dc:date>2024-11-16T20:00:19Z</dc:date>
    <item>
      <title>Switch... Case for coloring Sankey chart</title>
      <link>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1628674#M63388</link>
      <description>&lt;P&gt;I have a Sankey chart with a bunch of nodes that I want to assign different colors. I could probably do it in a pinch with nested if statements, but that's an ugly ugly kludge. What I want to do is use a Switch statement like you would in just about any other programming language... like this:&lt;/P&gt;&lt;P&gt;SWITCH&lt;/P&gt;&lt;P&gt;CASE 'A' Red();&lt;/P&gt;&lt;P&gt;CASE 'B' Blue();&lt;/P&gt;&lt;P&gt;CASE 'C' Green();&lt;/P&gt;&lt;P&gt;DEFAULT Black()&lt;/P&gt;&lt;P&gt;END SWITCH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know why SWITCH isn't available for color expressions? Or if there's a switch-like statement that I'm not finding?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:00:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1628674#M63388</guid>
      <dc:creator>McLaughlinMatt</dc:creator>
      <dc:date>2024-11-16T20:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Switch... Case for coloring Sankey chart</title>
      <link>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1628688#M63389</link>
      <description>&lt;P&gt;Check if you can use Pick function.&amp;nbsp; If requires n as integer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;pick(&lt;/SPAN&gt;&lt;SPAN class="bnf_token"&gt;n, expr1[ , expr2,...exprN]&lt;/SPAN&gt;&lt;SPAN class="script_token"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;pick(numcolor, Red(),Blue(),Green(),Black())&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;where numcolor = 1,2,3,4..&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;1 will return Red()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;2 will return Blue()&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;3 will return Green()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;4 will return Black()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;Check the help for more details&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="script_token"&gt;&lt;A href="https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFunctions/pick.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/June2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalFunctions/pick.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 14:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1628688#M63389</guid>
      <dc:creator>skamath1</dc:creator>
      <dc:date>2019-09-26T14:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Switch... Case for coloring Sankey chart</title>
      <link>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1736880#M63390</link>
      <description>&lt;P&gt;You can use pick() with match() on the node dimension:&lt;/P&gt;&lt;P&gt;=pick(match([Encounter Outcome],'Positive','Presumed Recovered','Recovered','Expired','Self Isolated'),'#FF0000','#00C016','#00FF40,'#C0C0C0','#0000FF')&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 19:04:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Switch-Case-for-coloring-Sankey-chart/m-p/1736880#M63390</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2020-08-18T19:04:42Z</dc:date>
    </item>
  </channel>
</rss>

