<?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 want to create conditional statement in where condition in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941245#M645395</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading one table where i want to provide a condition that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1)&amp;nbsp; IF User select Type = Booking&amp;nbsp;&amp;nbsp; than booking filter should add with where condition&lt;/P&gt;&lt;P&gt;(2) If user select Type = Arrival than arrival filter should Add with where condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is a field having 2 values ' Booking' and 'Arrival'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variables are given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vBooking&lt;/STRONG&gt; =([Booking Year] &amp;gt;= $(vBookingFromYear) and [Booking Year] &amp;lt;= $(vBookingToYear));&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vArrival&lt;/STRONG&gt; = Date([Arrival Date],'DD/MM/YYYY') &amp;gt;= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') &amp;lt;= Date(Today(),'DD/MM/YYYY') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script is given below:&lt;/P&gt;&lt;P&gt;booking_f:&lt;/P&gt;&lt;P&gt;LOAD [Booking WID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Person WID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(vQvdFileLocation)booking_f.qvd&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;//WHERE([Booking Year] &amp;gt;= $(vBookingFromYear) and [Booking Year] &amp;lt;= $(vBookingToYear))&lt;/P&gt;&lt;P&gt;//and Date([Arrival Date],'DD/MM/YYYY') &amp;gt;= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') &amp;lt;= Date(Today(),'DD/MM/YYYY')&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick( Match ( Type, 'Booking', 'Arrival')&lt;/P&gt;&lt;P&gt;,'$(vBooking)','$(vArrival)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest ................the possible solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Nov 2015 09:21:17 GMT</pubDate>
    <dc:creator>qliklearnervir</dc:creator>
    <dc:date>2015-11-05T09:21:17Z</dc:date>
    <item>
      <title>want to create conditional statement in where condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941245#M645395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am loading one table where i want to provide a condition that :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1)&amp;nbsp; IF User select Type = Booking&amp;nbsp;&amp;nbsp; than booking filter should add with where condition&lt;/P&gt;&lt;P&gt;(2) If user select Type = Arrival than arrival filter should Add with where condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is a field having 2 values ' Booking' and 'Arrival'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;variables are given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vBooking&lt;/STRONG&gt; =([Booking Year] &amp;gt;= $(vBookingFromYear) and [Booking Year] &amp;lt;= $(vBookingToYear));&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vArrival&lt;/STRONG&gt; = Date([Arrival Date],'DD/MM/YYYY') &amp;gt;= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') &amp;lt;= Date(Today(),'DD/MM/YYYY') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Script is given below:&lt;/P&gt;&lt;P&gt;booking_f:&lt;/P&gt;&lt;P&gt;LOAD [Booking WID], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Person WID]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(vQvdFileLocation)booking_f.qvd&lt;/P&gt;&lt;P&gt;(qvd)&lt;/P&gt;&lt;P&gt;//WHERE([Booking Year] &amp;gt;= $(vBookingFromYear) and [Booking Year] &amp;lt;= $(vBookingToYear))&lt;/P&gt;&lt;P&gt;//and Date([Arrival Date],'DD/MM/YYYY') &amp;gt;= Date(Addmonths(Today(),-4),'DD/MM/YYYY') and Date([Arrival Date],'DD/MM/YYYY') &amp;lt;= Date(Today(),'DD/MM/YYYY')&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick( Match ( Type, 'Booking', 'Arrival')&lt;/P&gt;&lt;P&gt;,'$(vBooking)','$(vArrival)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest ................the possible solution&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 09:21:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941245#M645395</guid>
      <dc:creator>qliklearnervir</dc:creator>
      <dc:date>2015-11-05T09:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: want to create conditional statement in where condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941246#M645396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;Hi,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Create a variable like vType and definition as =GetFieldSelections(Type). So when the user selects "Booking" or "Arrival", it will be stored in the variable. Then you can use the variable in the script.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;booking_f:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Booking WID],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Person WID]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$(vQvdFileLocation)booking_f.qvd&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(qvd)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Pick( Match ( '$(vType)', 'Booking', 'Arrival')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,'$(vBooking)','$(vArrival)');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;Edit:&lt;/SPAN&gt; &lt;/STRONG&gt;Create the variable in front end. See the screenshot.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;IMG __jive_id="104002" alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/104002_Capture.PNG" style="height: 98px; width: 620px;" /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;After select the listbox, you can use the script to reload the data.&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 09:39:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941246#M645396</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-11-05T09:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: want to create conditional statement in where condition in script</title>
      <link>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941247#M645397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you need this selection during loading, you can do this with input fields (look in the help) but I do not suggest this way, It should be better to load everithing then filter the result through a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Nov 2015 09:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/want-to-create-conditional-statement-in-where-condition-in/m-p/941247#M645397</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2015-11-05T09:44:13Z</dc:date>
    </item>
  </channel>
</rss>

