<?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: Validating the incoming value in the Variable using Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272804#M102112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me suggest a non-macro way to accomplish the objective. Assume the Fieldname is "Customer" and the variable name if "vCustomer". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a bookmark using the search expression: &lt;/P&gt;&lt;P&gt; =Customer='$(vCustomer)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create an alert that applies the bookmark and uses for condition:&lt;/P&gt;&lt;P&gt;=GetSelectedCount(Customer)=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Assign an OnOpen action to apply the bookmark if you want the selection made. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Dec 2011 00:46:45 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2011-12-02T00:46:45Z</dc:date>
    <item>
      <title>Validating the incoming value in the Variable using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272802#M102110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cust variable - I have defined in the Select in field OnOpen has action&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub Customer&lt;BR /&gt;set CustomernoVar = ActiveDocument.Variables("Cust") &lt;BR /&gt;vCustomerNo = CustomernoVar.GetContent.String&lt;BR /&gt;msgbox(vCustomerNo)&lt;/P&gt;&lt;P&gt;if vCustomerNo = ActiveDocument.Fields("Customer_No").getPossibleValues then&lt;BR /&gt;&amp;nbsp; msgbox(" Valid Customer")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ActiveDocument.Fields("Customer_No").Select(vCustomerNo)&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; else &lt;BR /&gt;&amp;nbsp;&amp;nbsp; msgbox("The customer is not valid")&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End sub&lt;/P&gt;&lt;P&gt;"Customer_No" is the data field in qlikview datamodel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to check the incoming variable value is valid customer or not in the field "Customer_No".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not working- if I provide invalid value for the Cust variable - it is not suppose to display anything. Please help on this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advance Thanks for your help &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 21:10:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272802#M102110</guid>
      <dc:creator />
      <dc:date>2011-12-01T21:10:32Z</dc:date>
    </item>
    <item>
      <title>Validating the incoming value in the Variable using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272803#M102111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is example code from the API Guide that shows how to loop through each possible value in a field.&lt;/P&gt;&lt;P&gt;You will need to compare vCustomerNo with each possible value and set a flag if you find a match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set val=ActiveDocument.Fields("Month").GetPossibleValues&lt;/P&gt;&lt;P&gt;for i=0 to val.Count-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; msgbox(val.Item(i).Text)&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 22:29:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272803#M102111</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2011-12-01T22:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Validating the incoming value in the Variable using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272804#M102112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let me suggest a non-macro way to accomplish the objective. Assume the Fieldname is "Customer" and the variable name if "vCustomer". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create a bookmark using the search expression: &lt;/P&gt;&lt;P&gt; =Customer='$(vCustomer)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Create an alert that applies the bookmark and uses for condition:&lt;/P&gt;&lt;P&gt;=GetSelectedCount(Customer)=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Assign an OnOpen action to apply the bookmark if you want the selection made. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 00:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272804#M102112</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-12-02T00:46:45Z</dc:date>
    </item>
    <item>
      <title>Validating the incoming value in the Variable using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272805#M102113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Rob,&lt;/P&gt;&lt;P&gt;Thanks for the quick solution.&lt;/P&gt;&lt;P&gt;It is not going to work for my case.&lt;/P&gt;&lt;P&gt;Cust is always carry some values -I would like to verify the incoming &lt;STRONG&gt;&lt;STRONG&gt;Cus&lt;/STRONG&gt;&lt;STRONG&gt; &lt;/STRONG&gt;t&lt;/STRONG&gt; values are available in the &lt;STRONG&gt;Customer_No &lt;/STRONG&gt;&lt;STRONG&gt; &lt;/STRONG&gt;field or not.If Cust has value which is not available in &lt;STRONG&gt;Customer_No - I don't need to show the report.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Advance thanks for your help.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 19:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Validating-the-incoming-value-in-the-Variable-using-Macro/m-p/272805#M102113</guid>
      <dc:creator />
      <dc:date>2011-12-05T19:29:28Z</dc:date>
    </item>
  </channel>
</rss>

