<?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 IF...ELSE not working in advanced filter in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978940#M18899</link>
    <description>&lt;P&gt;In the past when working on Visual Analytics (version 3 I think), I could use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;if ()
   return ()
   else ()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;And have used that in the past quite a few times with parameters for a search text input field. E.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;IF (notmissing('parameter_name'p))
    RETURN (Contains(comlumm_name, 'parameter_name'p))
ELSE (1 == 1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: very basic example, which when nothing is typed in the search field will show all results, otherwise only those which contain the search text.&lt;BR /&gt;&lt;BR /&gt;However, since VA is updated to Viya, version 4 I believe, I get this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RVO_0-1763387236380.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111322iA99DEA06676DC0B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RVO_0-1763387236380.png" alt="RVO_0-1763387236380.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Anyone any ideas why? Did something change in VA 4?&lt;BR /&gt;&lt;BR /&gt;I am also unable to find a solution that achieves the same, where I can use the text input with wildcard search to return all similar results.&lt;BR /&gt;&lt;BR /&gt;Nb: suggestion that a text-input field with the data-column to search as a data-field is not useful for two reasons:&lt;BR /&gt;1. I require to search in multiple columns at once&lt;/P&gt;&lt;P&gt;2. You only return the exact result. So if searching for "cat", you options "cats" and "caterpillar", but when selecting either of them, you don't get the other, whereas I want to show both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Nov 2025 13:50:40 GMT</pubDate>
    <dc:creator>RVO</dc:creator>
    <dc:date>2025-11-17T13:50:40Z</dc:date>
    <item>
      <title>IF...ELSE not working in advanced filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978940#M18899</link>
      <description>&lt;P&gt;In the past when working on Visual Analytics (version 3 I think), I could use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;if ()
   return ()
   else ()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;And have used that in the past quite a few times with parameters for a search text input field. E.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;IF (notmissing('parameter_name'p))
    RETURN (Contains(comlumm_name, 'parameter_name'p))
ELSE (1 == 1)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: very basic example, which when nothing is typed in the search field will show all results, otherwise only those which contain the search text.&lt;BR /&gt;&lt;BR /&gt;However, since VA is updated to Viya, version 4 I believe, I get this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RVO_0-1763387236380.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111322iA99DEA06676DC0B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RVO_0-1763387236380.png" alt="RVO_0-1763387236380.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Anyone any ideas why? Did something change in VA 4?&lt;BR /&gt;&lt;BR /&gt;I am also unable to find a solution that achieves the same, where I can use the text input with wildcard search to return all similar results.&lt;BR /&gt;&lt;BR /&gt;Nb: suggestion that a text-input field with the data-column to search as a data-field is not useful for two reasons:&lt;BR /&gt;1. I require to search in multiple columns at once&lt;/P&gt;&lt;P&gt;2. You only return the exact result. So if searching for "cat", you options "cats" and "caterpillar", but when selecting either of them, you don't get the other, whereas I want to show both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 13:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978940#M18899</guid>
      <dc:creator>RVO</dc:creator>
      <dc:date>2025-11-17T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: IF...ELSE not working in advanced filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978945#M18900</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439866"&gt;@RVO&lt;/a&gt;! The reason you are getting this error is because you only need one = rather than two. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (1=1)
    return 1=1
else 0=0&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, in Viya 4 you can add comments with // or /* */!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Stu_SAS_0-1763388480375.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111324i7C372F26CD246B62/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Stu_SAS_0-1763388480375.png" alt="Stu_SAS_0-1763388480375.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example video I have of implementing this text search filter here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://youtu.be/iMtoJXDZVRk?si=aVoWXR6gQ5GqCO_f&amp;amp;t=182" target="_blank"&gt;https://youtu.be/iMtoJXDZVRk?si=aVoWXR6gQ5GqCO_f&amp;amp;t=182&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 14:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978945#M18900</guid>
      <dc:creator>Stu_SAS</dc:creator>
      <dc:date>2025-11-17T14:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: IF...ELSE not working in advanced filter</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978946#M18901</link>
      <description>&lt;P&gt;The double "=" to single worked, thanks for the help.&lt;/P&gt;&lt;P&gt;Did not know this changed (it is not hinted at when using the if..else formula). A good change, was always strange in previous VA version to use "==", but a good example how inconsistency between version can cause problems &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 14:21:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/IF-ELSE-not-working-in-advanced-filter/m-p/978946#M18901</guid>
      <dc:creator>RVO</dc:creator>
      <dc:date>2025-11-17T14:21:15Z</dc:date>
    </item>
  </channel>
</rss>

