<?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 condition problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150990#M28925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There doesnt look any problem with the condtion. it works perfect when the variable value is hardcoded with A or B or C.&lt;/P&gt;&lt;P&gt;i.e &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;vTable= 'A'; or 'B'; or 'C';&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that its variable is unable to get value from the select query.. i.e.&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Let 'vTable'= 'select TableName from [dbo].[UserInput]'; //this fetches value A or B or C&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Is there any other way to resolve&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 06:10:13 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-08-04T06:10:13Z</dc:date>
    <item>
      <title>if else condition problem</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150989#M28924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;Below is the query am running in a qvw.&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;1.I am dynamically loading the value of a select query into a variable vtable&lt;/P&gt;&lt;P&gt;Is there any problem in my synatx below. my conditions are not getting checked ..by default condition is going to Else statement&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;=====================================================================&lt;/P&gt;&lt;P&gt;Let 'vTable'= 'select TableName from [dbo].[UserInput]'; //userinput could be A or B or C&lt;/P&gt;&lt;P&gt;if '$vTable'='A' THEN&lt;/P&gt;&lt;P&gt;A_Temp:&lt;BR /&gt;SELECT JobNumber as ABCJCJN, [JobName], [JobType], [SchedulerContactTime], [JobStartTime], [JobEndTime], [AbnormalEndTime], [AbnormalEndReason], [JobStatus], [SourceSystem], [ParameterList], [UserID], [WaitingForJobNumber], [ExtractTime], [As Of Date], [ThreadNumber], [ABCErrorReason], [Region], [AsOfDateOverrideFlag], [AppWaitingFlag], [RunBaselineToday], [IsMonthEnd], [IsQuarterEnd], [IsYearEnd], [MaintenanceLocation], [NextAsOfDate] FROM [TCRAuditBalanceControl].[dbo].[TempTable];&lt;/P&gt;&lt;P&gt;elseif '$vTable'='B' then&lt;/P&gt;&lt;P&gt;B_temp:&lt;BR /&gt;SELECT JobNumber as ABCEFJN, [ExtractFileName], [FolderLocation], [FileCreateTime], [NumberOfRows], [NetVolumeKBBL], [NetVolumeKT] FROM [TCRAuditBalanceControl].[dbo].[TempTable];&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;C_Temp:&lt;BR /&gt;SELECT [MessageNumber], [TimeStamp], JobName as ABCMJname, JobNumber as ABCMLJN, SourceSystem as ABCMSS, [Scope], AsOfDate as ABCMAOD, [MessageText], [SubSystem], [CallingProgram], [CriticalFlag] FROM [TCRAuditBalanceControl].[dbo].[TempTable];&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;============================================================================&lt;/P&gt;&lt;P&gt;Your inputs appreciated&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:18:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150989#M28924</guid>
      <dc:creator />
      <dc:date>2009-08-04T05:18:42Z</dc:date>
    </item>
    <item>
      <title>if else condition problem</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150990#M28925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There doesnt look any problem with the condtion. it works perfect when the variable value is hardcoded with A or B or C.&lt;/P&gt;&lt;P&gt;i.e &lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Set&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;vTable= 'A'; or 'B'; or 'C';&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that its variable is unable to get value from the select query.. i.e.&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Let 'vTable'= 'select TableName from [dbo].[UserInput]'; //this fetches value A or B or C&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Is there any other way to resolve&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;B&gt;&lt;/B&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150990#M28925</guid>
      <dc:creator />
      <dc:date>2009-08-04T06:10:13Z</dc:date>
    </item>
    <item>
      <title>if else condition problem</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150991#M28926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;In simple terms how can I set a variable which gets value from select query during run time of the qvw application?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:26:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150991#M28926</guid>
      <dc:creator />
      <dc:date>2009-08-04T06:26:16Z</dc:date>
    </item>
    <item>
      <title>if else condition problem</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150992#M28927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is something we use, might be a better way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;test:&lt;BR /&gt;SQL SELECT TableName&lt;BR /&gt;FROM [dbo].[UserInput];&lt;BR /&gt;LET vTable = FieldValue('TableName', 1);&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 23:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150992#M28927</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-04T23:58:18Z</dc:date>
    </item>
    <item>
      <title>if else condition problem</title>
      <link>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150993#M28928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, when calling variables in QlikView you can't do it like this:&lt;/P&gt;&lt;P&gt;'$vTable'&lt;/P&gt;&lt;P&gt;But instead you need to call it using $(vTable) or '$(vTable)' depending on if it contains a string value or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 09:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-else-condition-problem/m-p/150993#M28928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-08-05T09:22:18Z</dc:date>
    </item>
  </channel>
</rss>

