<?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 clause in the script of Qlikview &amp;lt;Script line error&amp;gt; in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392727#M820053</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'm new to Qlikview, Could anyone help me in using a '&lt;STRONG&gt;if else&lt;/STRONG&gt;' clause in the script level of Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to run a SQL Query based on IF ELSE condition, the satisfied condition i want to save it in a qvd. I get a script line error as in the screen shots at IF and Else statement line. when clicked 'ok' in the error, both the SQL statements run and fetch data in Qlikview.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;IF (weekday(today())='Sat')&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TABLE1;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TABLE2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Here is the SQL query used in the Mysql (SQL Server) Database.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;if exists (select 1 WHERE datename(WEEKDAY,GETDATE())='Monday')&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;SELECT * FROM&amp;nbsp; TABLE1&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;else &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt; SELECT * FROM&amp;nbsp; TABLE2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: shyam kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>shmkmr90</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392727#M820053</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'm new to Qlikview, Could anyone help me in using a '&lt;STRONG&gt;if else&lt;/STRONG&gt;' clause in the script level of Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to run a SQL Query based on IF ELSE condition, the satisfied condition i want to save it in a qvd. I get a script line error as in the screen shots at IF and Else statement line. when clicked 'ok' in the error, both the SQL statements run and fetch data in Qlikview.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;IF (weekday(today())='Sat')&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TABLE1;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;SQL SELECT * FROM TABLE2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Here is the SQL query used in the Mysql (SQL Server) Database.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;if exists (select 1 WHERE datename(WEEKDAY,GETDATE())='Monday')&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;SELECT * FROM&amp;nbsp; TABLE1&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;else &lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt; SELECT * FROM&amp;nbsp; TABLE2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: shyam kumar&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/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392727#M820053</guid>
      <dc:creator>shmkmr90</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392728#M820054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed a syntax error in the query which i shared earlier (Missed THEN in the example). But However when i give a table name and store it in a qvd, it is throwing an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Temp:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;IF (weekday(today())='Sat')&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;SQL SELECT * FROM TABLE1;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;ELSE&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;SQL SELECT * FROM TABLE2;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;LOAD TEMP INTO TABLE.qvd;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Guide me. Many Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Aug 2017 14:41:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392728#M820054</guid>
      <dc:creator>shmkmr90</dc:creator>
      <dc:date>2017-08-12T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392729#M820055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Missing a &lt;STRONG&gt;'Then'&amp;nbsp; &lt;/STRONG&gt;may be?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 07:34:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392729#M820055</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-14T07:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392730#M820056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be like below. Remove Parenthesis in your IF statement. Because, IF statement need two arguments&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;IF weekday(today())='Sat' THEN&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;SQL SELECT * FROM TABLE1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;ELSE&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;SQL SELECT * FROM TABLE2;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 07:44:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392730#M820056</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-14T07:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392731#M820057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="if.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/173309_if.png" style="height: 197px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 07:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392731#M820057</guid>
      <dc:creator>prma7799</dc:creator>
      <dc:date>2017-08-14T07:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392732#M820058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/218859"&gt;loveisfail&lt;/A&gt;‌ one small correction you should close the if condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF weekday(today())='Sat' THEN&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT * FROM TABLE1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ELSE&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SQL SELECT * FROM TABLE2;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;END IF&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 07:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392732#M820058</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-08-14T07:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: If else clause in the script of Qlikview &lt;Script line error&gt;</title>
      <link>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392733#M820059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Noted !! But, I don't think whether we need close IF statement like you mentioned. Tested and done. This Statement required when we having the script after that Else statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for correct root &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 07:55:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-else-clause-in-the-script-of-Qlikview-lt-Script-line-error-gt/m-p/1392733#M820059</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-14T07:55:45Z</dc:date>
    </item>
  </channel>
</rss>

