<?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 How to use if and else command for select which portion of script to load ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647649#M593116</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I have below script work fine.&lt;/P&gt;&lt;P&gt;Some time i need to only run country A. what i do is manually go to country B script comment it.&lt;BR /&gt;May i know how to using if then else command to handle it , so that i can just enter 1 or 2 to select which country to run.&lt;BR /&gt;Hope some one can advise me.&lt;/P&gt;&lt;P&gt;Paul Yeo&lt;/P&gt;&lt;P&gt;// sales COUNTRY A&lt;BR /&gt;sales:&lt;BR /&gt;LOAD left(FileBaseName(), 4) AS Report_dod_1,&lt;BR /&gt;@50:60T as [date],&lt;BR /&gt;'TDS' as SOURCE,&lt;BR /&gt;if(@241:248T = '2',@134:147T*-1,@134:147T) as [sales]&lt;BR /&gt;FROM C:\Users\Paul Yeo\Dropbox\5 QV_Final\QV_RAW\Q_DOD_2018.txt (ansi, fix, no labels, header is 0, record is line);&lt;/P&gt;&lt;P&gt;// sales COUNTRY B&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD&lt;BR /&gt;'PMC' as SOURCE,&lt;BR /&gt;Date( Date#([AR Invoice Date], 'DD.MM.YY'), 'DD/YY/YYY') as [date],&lt;BR /&gt;[Customer Name] AS COMPANY,&lt;BR /&gt;[Row Total (SGD)] as sales&lt;BR /&gt;FROM [C:\Users\Paul Yeo\OneDrive - ISDN Holdings Limited\RAW DATA SAP\SO_PMC_2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is SO_PMC_2019);&lt;/P&gt;&lt;P&gt;// AR COUNTRY A&lt;BR /&gt;Payment:&lt;BR /&gt;LOAD&lt;BR /&gt;'TDS' as SOURCE,&lt;BR /&gt;@1:9T as [cust_id_ar],&lt;BR /&gt;left(@10:38T,25) as [company_ar],&lt;BR /&gt;if(right(@73:90T,1)='-', '-' &amp;amp; left(@73:90T, len(@73:90T)-1),@73:90T) as total_ar,&lt;BR /&gt;Today() - @98:110T as [total number of day due]&lt;BR /&gt;&lt;BR /&gt;FROM C:\Users\Paul Yeo\Dropbox\5 QV_Final\QV_RAW\AR_Aging.TXT (ansi, fix, no labels, header is 0, record is line);&lt;/P&gt;&lt;P&gt;// AR COUNTRY B&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD&lt;BR /&gt;'PMC' as SOURCE,&lt;BR /&gt;[Customer/Vendor Code] as [cust_id_ar],&lt;BR /&gt;[Customer/Vendor Name] as company_ar,&lt;BR /&gt;Today() - Date( Date#([AR Invoice Date], 'DD.MM.YY'), 'DD/YY/YYY') as [total number of day due],&lt;BR /&gt;[Outstanding w/o Tax (LC)] as total_ar&lt;BR /&gt;FROM [C:\Users\Paul Yeo\OneDrive - ISDN Holdings Limited\RAW DATA SAP\AR_PMC.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is AR_PMC);&lt;/P&gt;&lt;P&gt;tmp:&lt;BR /&gt;LOAD&lt;BR /&gt;min(date) AS MinDate,&lt;BR /&gt;max(date) AS MaxDate&lt;BR /&gt;RESIDENT sales;&lt;BR /&gt;MaxMinDate:&lt;BR /&gt;NOCONCATENATE LOAD&lt;BR /&gt;MIN(MinDate) AS MinDate,&lt;BR /&gt;MAX(MaxDate) AS MaxDate&lt;BR /&gt;RESIDENT tmp;&lt;BR /&gt;DROP TABLE tmp;&lt;BR /&gt;LET varMinDate = Num(Peek('MinDate'));&lt;BR /&gt;LET varMaxDate = Num(Peek('MaxDate'));&lt;BR /&gt;LET vToday = num(today());&lt;BR /&gt;DROP TABLE MaxMinDate;&lt;BR /&gt;//*************** Temporary Calendar ***************&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;$(varMinDate) + rowno() - 1 AS Num,&lt;BR /&gt;date($(varMinDate) + rowno() - 1) AS TempDate,&lt;BR /&gt;date($(varMinDate) + rowno() - 1) AS D,&lt;BR /&gt;year($(varMinDate) + rowno() - 1) AS Y,&lt;BR /&gt;month($(varMinDate) + rowno() - 1) AS M,&lt;BR /&gt;date(monthstart($(varMinDate) + rowno() - 1), 'MMM-YYYY') AS MY&lt;BR /&gt;AUTOGENERATE $(varMaxDate) - $(varMinDate) + 1;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD TempDate AS date,&lt;BR /&gt;day([TempDate]) as [day],&lt;BR /&gt;num(month([TempDate])) as [month],&lt;BR /&gt;Y AS year&lt;BR /&gt;RESIDENT TempCalendar&lt;BR /&gt;ORDER BY TempDate ASC;&lt;BR /&gt;DROP TABLE TempCalendar;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2019 04:19:39 GMT</pubDate>
    <dc:creator>paulyeo11</dc:creator>
    <dc:date>2019-11-16T04:19:39Z</dc:date>
    <item>
      <title>How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647649#M593116</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I have below script work fine.&lt;/P&gt;&lt;P&gt;Some time i need to only run country A. what i do is manually go to country B script comment it.&lt;BR /&gt;May i know how to using if then else command to handle it , so that i can just enter 1 or 2 to select which country to run.&lt;BR /&gt;Hope some one can advise me.&lt;/P&gt;&lt;P&gt;Paul Yeo&lt;/P&gt;&lt;P&gt;// sales COUNTRY A&lt;BR /&gt;sales:&lt;BR /&gt;LOAD left(FileBaseName(), 4) AS Report_dod_1,&lt;BR /&gt;@50:60T as [date],&lt;BR /&gt;'TDS' as SOURCE,&lt;BR /&gt;if(@241:248T = '2',@134:147T*-1,@134:147T) as [sales]&lt;BR /&gt;FROM C:\Users\Paul Yeo\Dropbox\5 QV_Final\QV_RAW\Q_DOD_2018.txt (ansi, fix, no labels, header is 0, record is line);&lt;/P&gt;&lt;P&gt;// sales COUNTRY B&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD&lt;BR /&gt;'PMC' as SOURCE,&lt;BR /&gt;Date( Date#([AR Invoice Date], 'DD.MM.YY'), 'DD/YY/YYY') as [date],&lt;BR /&gt;[Customer Name] AS COMPANY,&lt;BR /&gt;[Row Total (SGD)] as sales&lt;BR /&gt;FROM [C:\Users\Paul Yeo\OneDrive - ISDN Holdings Limited\RAW DATA SAP\SO_PMC_2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is SO_PMC_2019);&lt;/P&gt;&lt;P&gt;// AR COUNTRY A&lt;BR /&gt;Payment:&lt;BR /&gt;LOAD&lt;BR /&gt;'TDS' as SOURCE,&lt;BR /&gt;@1:9T as [cust_id_ar],&lt;BR /&gt;left(@10:38T,25) as [company_ar],&lt;BR /&gt;if(right(@73:90T,1)='-', '-' &amp;amp; left(@73:90T, len(@73:90T)-1),@73:90T) as total_ar,&lt;BR /&gt;Today() - @98:110T as [total number of day due]&lt;BR /&gt;&lt;BR /&gt;FROM C:\Users\Paul Yeo\Dropbox\5 QV_Final\QV_RAW\AR_Aging.TXT (ansi, fix, no labels, header is 0, record is line);&lt;/P&gt;&lt;P&gt;// AR COUNTRY B&lt;BR /&gt;Concatenate&lt;BR /&gt;LOAD&lt;BR /&gt;'PMC' as SOURCE,&lt;BR /&gt;[Customer/Vendor Code] as [cust_id_ar],&lt;BR /&gt;[Customer/Vendor Name] as company_ar,&lt;BR /&gt;Today() - Date( Date#([AR Invoice Date], 'DD.MM.YY'), 'DD/YY/YYY') as [total number of day due],&lt;BR /&gt;[Outstanding w/o Tax (LC)] as total_ar&lt;BR /&gt;FROM [C:\Users\Paul Yeo\OneDrive - ISDN Holdings Limited\RAW DATA SAP\AR_PMC.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is AR_PMC);&lt;/P&gt;&lt;P&gt;tmp:&lt;BR /&gt;LOAD&lt;BR /&gt;min(date) AS MinDate,&lt;BR /&gt;max(date) AS MaxDate&lt;BR /&gt;RESIDENT sales;&lt;BR /&gt;MaxMinDate:&lt;BR /&gt;NOCONCATENATE LOAD&lt;BR /&gt;MIN(MinDate) AS MinDate,&lt;BR /&gt;MAX(MaxDate) AS MaxDate&lt;BR /&gt;RESIDENT tmp;&lt;BR /&gt;DROP TABLE tmp;&lt;BR /&gt;LET varMinDate = Num(Peek('MinDate'));&lt;BR /&gt;LET varMaxDate = Num(Peek('MaxDate'));&lt;BR /&gt;LET vToday = num(today());&lt;BR /&gt;DROP TABLE MaxMinDate;&lt;BR /&gt;//*************** Temporary Calendar ***************&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;$(varMinDate) + rowno() - 1 AS Num,&lt;BR /&gt;date($(varMinDate) + rowno() - 1) AS TempDate,&lt;BR /&gt;date($(varMinDate) + rowno() - 1) AS D,&lt;BR /&gt;year($(varMinDate) + rowno() - 1) AS Y,&lt;BR /&gt;month($(varMinDate) + rowno() - 1) AS M,&lt;BR /&gt;date(monthstart($(varMinDate) + rowno() - 1), 'MMM-YYYY') AS MY&lt;BR /&gt;AUTOGENERATE $(varMaxDate) - $(varMinDate) + 1;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD TempDate AS date,&lt;BR /&gt;day([TempDate]) as [day],&lt;BR /&gt;num(month([TempDate])) as [month],&lt;BR /&gt;Y AS year&lt;BR /&gt;RESIDENT TempCalendar&lt;BR /&gt;ORDER BY TempDate ASC;&lt;BR /&gt;DROP TABLE TempCalendar;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2019 04:19:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647649#M593116</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2019-11-16T04:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647682#M593117</link>
      <description>Check if you can do the Partial reload option here, that might help you.&lt;BR /&gt;Another point, how you are deciding, when to load A or B?</description>
      <pubDate>Sat, 16 Nov 2019 17:10:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647682#M593117</guid>
      <dc:creator>agni_gold</dc:creator>
      <dc:date>2019-11-16T17:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647706#M593118</link>
      <description>Hi Gold&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply.&lt;BR /&gt;&lt;BR /&gt;You mentioned partial reload. Which I am not sure what you mean.&lt;BR /&gt;&lt;BR /&gt;You also mentioned in what situation I choose to run A or B ? Good question . Actually I just want to skip some of the load script to speed up the testing.&lt;BR /&gt;&lt;BR /&gt;Paul&lt;BR /&gt;</description>
      <pubDate>Sat, 16 Nov 2019 23:01:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647706#M593118</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2019-11-16T23:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647715#M593120</link>
      <description>In Qlikview there is an option for Partial reload,&lt;BR /&gt;but for qliksense , please see below post&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://support.qlik.com/articles/000046093" target="_blank"&gt;https://support.qlik.com/articles/000046093&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Nov 2019 07:34:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647715#M593120</guid>
      <dc:creator>agni_gold</dc:creator>
      <dc:date>2019-11-17T07:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647717#M593122</link>
      <description>Hi Sir&lt;BR /&gt;&lt;BR /&gt;I think you must have Mia-undrestand my question . My issue is not about partial reload.&lt;BR /&gt;&lt;BR /&gt;Paul&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Nov 2019 07:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647717#M593122</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2019-11-17T07:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647718#M593123</link>
      <description>&lt;P&gt;i understood your question, but you need to get on what conditions you want to run a particular script, otherwise, it is not directly possible as per my knowledge.&lt;/P&gt;&lt;P&gt;you need to tweak your solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Nov 2019 07:42:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647718#M593123</guid>
      <dc:creator>agni_gold</dc:creator>
      <dc:date>2019-11-17T07:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647719#M593124</link>
      <description>Hi Sir&lt;BR /&gt;&lt;BR /&gt;I am sorry that I though you not understand.&lt;BR /&gt;&lt;BR /&gt;May I know how you make use for partial reload to solve my issue ?&lt;BR /&gt;&lt;BR /&gt;Paul&lt;BR /&gt;</description>
      <pubDate>Sun, 17 Nov 2019 07:47:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1647719#M593124</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2019-11-17T07:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use if and else command for select which portion of script to load ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1649183#M593125</link>
      <description>&lt;P&gt;Paul, have a look at the following Help links, hopefully this may make some sense, along the Partial Reload suggestion, I do believe this should work as noted by the other poster.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Partial%20Reload.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Partial%20Reload.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think you likely would want to use the Replace option on the load of Country A when running the partial reload, but I do not know if you need to load all the other tables or not etc.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best bet may be to create a new app and play around with things a bit there until you get comfortable with what is happening when...&amp;nbsp; Hopefully this helps you move things forward.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 14:47:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-if-and-else-command-for-select-which-portion-of/m-p/1649183#M593125</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-11-20T14:47:01Z</dc:date>
    </item>
  </channel>
</rss>

