<?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 Re: Setting Field Value To Zero in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381485#M810405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. You should create separate expressions (columns) for NET_ASSETS and ASSET_COUNT.&lt;/P&gt;&lt;P&gt;2. When using wildcard in a string test, the operator is LIKE, not "=". You can also use the WildMatch() function which is a bit easier when looking for multiple values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your NET_ASSETS expression will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sum(if(WildMatch(COMP, 'SAN*', 'NAS*'), 0, NET_ASSETS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the same thing in Set Analysis syntax (which should be more efficient):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sum({&amp;lt;COMP-={"&lt;SPAN style="font-size: 13.3333px;"&gt;SAN*", "NAS*"&lt;/SPAN&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;NET_ASSETS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Your ASSET_COUNT expression is the same, substituting &lt;SPAN style="font-size: 13.3333px;"&gt;ASSET_COUNT for the field name. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Oct 2017 22:02:05 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2017-10-02T22:02:05Z</dc:date>
    <item>
      <title>Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381482#M810400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a straight table with multiple columns, but for this question, there are columns in play and they are COMP (describes a storage tier), ASSET_COUNT (number of assets for the row) and NET_ASSETS (could be a negative number (for removes), a positive number or zero).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For rows that have a COMP value starting with SAN* or NAS*, I want to set ASSET_COUNT and NET_ASSETS to zero as I do not want to count assets for the storage rows whether it be a remove or add.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried &lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COMP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'SAN*' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;COMP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 'NAS*', &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NET_ASSETS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ASSET_COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = 0) &lt;/SPAN&gt;, which does not appear to do anything.&amp;nbsp; Does anyone have any suggestions?&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381482#M810400</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381483#M810402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should add that I have a second expression which does sum the rows I want to sum for an asset count and that expression is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NET_ASSETS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt; 0 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NET_ASSETS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;lt; 0, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;NET_ASSETS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ASSET_COUNT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 19:00:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381483#M810402</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2017-10-02T19:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381484#M810403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try wildmatch function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/ConditionalFunctions/wildmatch.htm" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/ConditionalFunctions/wildmatch.htm"&gt;wildmatch ‒ QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lorenzo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 22:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381484#M810403</guid>
      <dc:creator>lorenzoconforti</dc:creator>
      <dc:date>2017-10-02T22:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381485#M810405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. You should create separate expressions (columns) for NET_ASSETS and ASSET_COUNT.&lt;/P&gt;&lt;P&gt;2. When using wildcard in a string test, the operator is LIKE, not "=". You can also use the WildMatch() function which is a bit easier when looking for multiple values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So your NET_ASSETS expression will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sum(if(WildMatch(COMP, 'SAN*', 'NAS*'), 0, NET_ASSETS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the same thing in Set Analysis syntax (which should be more efficient):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;sum({&amp;lt;COMP-={"&lt;SPAN style="font-size: 13.3333px;"&gt;SAN*", "NAS*"&lt;/SPAN&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;NET_ASSETS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Your ASSET_COUNT expression is the same, substituting &lt;SPAN style="font-size: 13.3333px;"&gt;ASSET_COUNT for the field name. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 22:02:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381485#M810405</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-10-02T22:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381486#M810406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Lorenzo:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for the response.&amp;nbsp; I appreciate it.&amp;nbsp; I've bookmarked the link which I'm sure I'll reference in the future.&amp;nbsp; Again, I appreciate you taking the time to respond.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 23:26:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381486#M810406</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2017-10-02T23:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381487#M810408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for taking the time to respond.&amp;nbsp; I appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do have two distinct columns, one for NET_ASSETS and one for ASSET_COUNT.&amp;nbsp; Sorry I wasn't clear on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both of your solutions work for me.&amp;nbsp; Thank you.&amp;nbsp; To make sure I understand (and hopefully learn something), when you say LIKE (I'm used to that type of syntax in SQL), (WILDMATCH(COMP, 'SAN*', 'NAS*') says when there's a LIKE match of either SAN* or NAS* for COMP, then set the value of NET_ASSETS to 0.&amp;nbsp; Is that right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And for set analysis, it essentially says the same thing except only sum NET_ASSETS if COMP is LIKE SAN* or NAS*.&amp;nbsp; Correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, I shouldn't try to combine NET_ASSETS and ASSET_COUNT in the same expression, even though they are separate columns?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2017 23:37:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381487#M810408</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2017-10-02T23:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381488#M810410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Perry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My reference to LIKE was as an operator in the first statement you gave.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;if(COMP LIKE '*NAS' OR COMP LIKE '*SAN', ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE (as apposed to =), as in SQL, indicates * and ? in the argument that follow should be considered wildcards.&lt;/P&gt;&lt;P&gt;COMP = '*'NAS' would be looking for a literal asterisk, not a wildcard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The WildMatch function is just a more convenient form of testing multiple values instead of having to write OR. Yes, your understanding is correct, although I might phrase it differently than "set the value".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"If there is a match, add 0 to the sum. Otherwise add the value of NET_ASSETS to the sum.".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may also be written with a NOT operator like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;sum(if(NOT WildMatch(COMP, 'SAN*', 'NAS*'),NET_ASSETS)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;meaning "If there is no match, add the value of NET_ASSETS to the sum. Otherwise add null (effectively zero) to the sum."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;Set Analysis syntax is like making or modifying selections before doing the aggregation. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;&lt;SPAN style="font-size: 13px; font-family: 'courier new', courier; color: #3d3d3d;"&gt;sum({&amp;lt;COMP-={"&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;SAN*", "NAS*"&lt;/SPAN&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier; color: #3d3d3d;"&gt;NET_ASSETS)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;The -= operator means "remove (exclude) these values from the current selections".&amp;nbsp; The double quotes " indicate the value list contains wildcards.&amp;nbsp; So rows matching those COMP values are first removed, then NET_ASSETS values are summed for the remaining rows. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: arial, helvetica, sans-serif;"&gt;Yes, you should sum NET_ASSETS and ASSET_COUNT in separate expressions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com/" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Oct 2017 13:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381488#M810410</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-10-03T13:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Field Value To Zero</title>
      <link>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381489#M810412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My apologies for the delay in replying.&amp;nbsp; It's been a crazy week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the explanation.&amp;nbsp; I appreciate it.&amp;nbsp; I've marked your first response as the correct answer.&amp;nbsp; Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2017 19:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Setting-Field-Value-To-Zero/m-p/1381489#M810412</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2017-10-05T19:27:00Z</dc:date>
    </item>
  </channel>
</rss>

