<?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: Cryptic error message: Syntax error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388749#M613583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put an &lt;SPAN style="font-family: 'courier new', courier;"&gt;exit;&lt;/SPAN&gt; statement after your vWeek assignment statement, and rerun your script. The script will stop at the exit statement which should work ok and give you a chance to inspect the different elements that (should) lead to a correct vWeek value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Settings-&amp;gt;Variable Overview to check the contents of variable vWeek. It will either be empty or non-existant.&lt;/P&gt;&lt;P&gt;That means that the assignment didn't work or couldn't find any data in column GB_Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the table viewer by pressing Ctrl-T, right click table Table_Week and select "Preview". Does this table contain any data at all? If not, you know where to start fixing your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Aug 2017 09:35:05 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-08-28T09:35:05Z</dc:date>
    <item>
      <title>Cryptic error message: Syntax error</title>
      <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388746#M613580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help. I'm losing my mind over this problem. &lt;STRONG&gt;I am trying a resident load from a table I created from a binary, but I'm keep getting a syntax error and I can't find where the error is! &lt;/STRONG&gt;(Image attached)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/174806_Capture1.PNG" style="height: 410px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached the whole code (sorry for the suboptimal structure but I'm still a rookie):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Last updated date 24/aug/2017. Developed by Julio Arriaga.&lt;/P&gt;&lt;P&gt;//This code creates two layouts. //The first one is a qvd generated for its use in the Corporate Sales apps.&lt;/P&gt;&lt;P&gt;//The other one is a txt file used by Manuel Mendez Sanchez in Marketing, agreggating sales by Product and Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This executes the binary statement.&lt;/P&gt;&lt;P&gt;binary [..\..\Models\Comercial\P&amp;amp;L\CB\Model_P&amp;amp;L_CB_GROUP.qvw];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='$#,##0.00;-$#,##0.00';&lt;/P&gt;&lt;P&gt;SET TimeFormat='hh:mm:ss TT';&lt;/P&gt;&lt;P&gt;SET DateFormat='DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff] TT';&lt;/P&gt;&lt;P&gt;SET MonthNames='ene.;feb.;mar.;abr.;may.;jun.;jul.;ago.;sep.;oct.;nov.;dic.';&lt;/P&gt;&lt;P&gt;SET DayNames='lun.;mar.;mié.;jue.;vie.;sáb.;dom.';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// This establishes the dates.&lt;/P&gt;&lt;P&gt;//let vRunFrom = Date(Today()-7); //This line is used for production.&lt;/P&gt;&lt;P&gt;//let vRunTo = Date(Today()-1); //This line is used for production.&lt;/P&gt;&lt;P&gt;let vRunFrom = Date(Date#('17/08/2017')); //This line is used for tests.&lt;/P&gt;&lt;P&gt;let vRunTo = Date(Date#('23/08/2017')); //This line is used for tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is used to to obtain the correspondent GB Week. &lt;/P&gt;&lt;P&gt;//This is used because not all records in the Fact table have assigned a GB_Week value for a reason that I don't know (I didn't develop this model).&lt;/P&gt;&lt;P&gt;Table_Week:&lt;/P&gt;&lt;P&gt;load Date(Bill_Date) as Bill_Date&lt;/P&gt;&lt;P&gt;,max(GB_Week) as GB_Week&lt;/P&gt;&lt;P&gt;resident Fact&lt;/P&gt;&lt;P&gt;where 1=1&lt;/P&gt;&lt;P&gt;and Date(Bill_Date)='$(vRunFrom)'&lt;/P&gt;&lt;P&gt;group by Bill_Date;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is to store the correspondent GB Week in a variable.&lt;/P&gt;&lt;P&gt;Let vWeek = peek('GB_Week',0,'Table_Week');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map_Sales_District:&lt;/P&gt;&lt;P&gt;mapping load Sales_District&lt;/P&gt;&lt;P&gt;,Sales_District_Name&lt;/P&gt;&lt;P&gt;resident Sales_District;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map_ChannelID:&lt;/P&gt;&lt;P&gt;mapping load Customer_Key&lt;/P&gt;&lt;P&gt;,Channel_ID&lt;/P&gt;&lt;P&gt;resident Customer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map_ChannelID2Name:&lt;/P&gt;&lt;P&gt;mapping load Channel_ID&lt;/P&gt;&lt;P&gt;,Channel_Name&lt;/P&gt;&lt;P&gt;resident ChannelID2Name;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map_ChannelName:&lt;/P&gt;&lt;P&gt;mapping load Customer_Key&lt;/P&gt;&lt;P&gt;,applymap('map_ChannelID2Name',Customer_Key,'Error')&lt;/P&gt;&lt;P&gt;resident Customer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map_BrandName:&lt;/P&gt;&lt;P&gt;mapping load Product_ID&lt;/P&gt;&lt;P&gt;,Brand_Name&lt;/P&gt;&lt;P&gt;resident Product;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is to create a temporal table to aggregate by the different divisions needed by Corporate Sales.&lt;/P&gt;&lt;P&gt;//The temp is created in order to filter by Bill_Date and then build the aggregated tables by Week, discarding Bill_Date.&lt;/P&gt;&lt;P&gt;//Although this method is more troublesome and not efficient, it was chosen in order to guarantee the correct representation of the data because I don't know thouroughly the model.&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;load Product_ID &lt;/P&gt;&lt;P&gt;,date(Bill_Date) as Bill_Date&lt;/P&gt;&lt;P&gt;,Customer_Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,Sales_District as Region //I need to properly map this field beause right now it is numerated by single digits.&lt;/P&gt;&lt;P&gt;,applymap('map_Sales_District',Sales_District,'Error') as [Region Name]&lt;/P&gt;&lt;P&gt;,if(Currency='CAD','102',Currency) as [Id Currency] //I need to properly map this field.&lt;/P&gt;&lt;P&gt;,Currency as [Currency Name]&lt;/P&gt;&lt;P&gt;,'CB' as Pais //I need to properly map this field.&lt;/P&gt;&lt;P&gt;,'127' as Id_Country&lt;/P&gt;&lt;P&gt;,applymap('map_ChannelID',Customer_Key,'Error') as [Channel ID]&lt;/P&gt;&lt;P&gt;,applymap('map_ChannelName',Customer_Key,'Error') as [Channel Name]&lt;/P&gt;&lt;P&gt;,applymap('map_BrandName',Product_ID,'Error') as [Brand Level4]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,sum(Total_Sales) as Total_Sales&lt;/P&gt;&lt;P&gt;,sum(Net_Invoice_Qty) as Net_Invoice_Qty&lt;/P&gt;&lt;P&gt;,sum(Total_Returns) as Total_Returns&lt;/P&gt;&lt;P&gt;,sum(Return_Invoice_Quantity) as Return_Invoice_Quantity&lt;/P&gt;&lt;P&gt;,sum(Net_Sales) as Net_Sales&lt;/P&gt;&lt;P&gt;Resident Fact&lt;/P&gt;&lt;P&gt;where 1=1&lt;/P&gt;&lt;P&gt;and date(Bill_Date)&amp;gt;='$(vRunFrom)'&lt;/P&gt;&lt;P&gt;and date(Bill_Date)&amp;lt;='$(vRunTo)'&lt;/P&gt;&lt;P&gt;group by Product_ID,date(Bill_Date),Customer_Key,Sales_District,applymap('map_Sales_District',Sales_District,'Error'),if(Currency='CAD','102',Currency)&lt;/P&gt;&lt;P&gt;,Currency,'CB','127',applymap('map_ChannelID',Customer_Key,'Error'),applymap('map_ChannelName',Customer_Key,'Error'),applymap('map_BrandName',Product_ID,'Error');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is the aggregation by Week, created from the Temp table.&lt;/P&gt;&lt;P&gt;Corp_Sales:&lt;/P&gt;&lt;P&gt;load Product_ID&lt;/P&gt;&lt;P&gt;,year(Bill_Date) as Fiscal_Year&lt;/P&gt;&lt;P&gt;,$(vWeek) as Week &lt;/P&gt;&lt;P&gt;,Customer_Key&lt;/P&gt;&lt;P&gt;,Region&lt;/P&gt;&lt;P&gt;,[Region Name]&lt;/P&gt;&lt;P&gt;,[Id Currency]&lt;/P&gt;&lt;P&gt;,[Currency Name]&lt;/P&gt;&lt;P&gt;,Pais&lt;/P&gt;&lt;P&gt;,Id_Country&lt;/P&gt;&lt;P&gt;,[Channel ID]&lt;/P&gt;&lt;P&gt;,[Channel Name]&lt;/P&gt;&lt;P&gt;,[Brand Level4]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;,sum(Total_Sales) as Total_Sales&lt;/P&gt;&lt;P&gt;,sum(Net_Invoice_Qty) as Net_Invoice_Qty&lt;/P&gt;&lt;P&gt;,sum([Total Returns]) as [Total Returns]&lt;/P&gt;&lt;P&gt;,sum(Return_Invoice_Quantity) as Return_Invoice_Quantity&lt;/P&gt;&lt;P&gt;,sum(Net_Sales) as Net_Sales&lt;/P&gt;&lt;P&gt;resident Temp&lt;/P&gt;&lt;P&gt;group by Product_ID,year(Bill_Date),$(vWeek),Customer_Key,Region,[Region Name],[Id Currency],[Currency Name],Pais,Id_Country&lt;/P&gt;&lt;P&gt;,[Channel ID],[Channel Name],[Brand Level4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is used to store the information for the Corporate Sales Layout.&lt;/P&gt;&lt;P&gt;STORE Corp_Sales into [..\USR_Files\Mapping_Files\Marketing\InputDevelopCom\CB_P&amp;amp;L_SalesCustomer_$(vWeek).qvd] (qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is to create a final table aggregated by Product, Week and Year (from Bill_Date) from the temporal table, dropping Bill_Date (needed for the layout).&lt;/P&gt;&lt;P&gt;Sales_MktTxt:&lt;/P&gt;&lt;P&gt;LOAD Product_ID &lt;/P&gt;&lt;P&gt;,year(Bill_Date) as Fiscal_Year&lt;/P&gt;&lt;P&gt;,Week &lt;/P&gt;&lt;P&gt;,sum(Total_Sales)&lt;/P&gt;&lt;P&gt;,sum(Net_Invoice_Qty)&lt;/P&gt;&lt;P&gt;,sum(Total_Returns)&lt;/P&gt;&lt;P&gt;,sum(Return_Invoice_Quantity)&lt;/P&gt;&lt;P&gt;,sum(Net_Sales)&lt;/P&gt;&lt;P&gt;Resident Sales&lt;/P&gt;&lt;P&gt;group by Product_ID,year(Bill_Date),$(vWeek);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is used to store the information as a particular name.&lt;/P&gt;&lt;P&gt;STORE Sales_MtTxt into [..\USR_Files\Mapping_Files\Marketing\MarketingTxt\IC_MKT_VEN_CB_$(vWeek).txt] (txt, delimiter is '|');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Dropping of unused tables.&lt;/P&gt;&lt;P&gt;drop table Metrics,Product,CalendarWeek,CalendarDay,Fact,Definition_Table,Sales_District,Customer,Product_Dimention,Customer_Dimention,Sales,Time_Dimension,Sales_Dimension,ChannelID2Name,Sales_Customer;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 00:46:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388746#M613580</guid>
      <dc:creator>julioarriaga</dc:creator>
      <dc:date>2017-08-28T00:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cryptic error message: Syntax error</title>
      <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388747#M613581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Julio,&lt;/P&gt;&lt;P&gt;Try replacing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;,$(vWeek) as Week&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;,&lt;STRONG&gt;'&lt;/STRONG&gt;$(vWeek)&lt;STRONG&gt;'&lt;/STRONG&gt; as Week&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Andrew&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 07:42:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388747#M613581</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-08-28T07:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cryptic error message: Syntax error</title>
      <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388748#M613582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that variable vWeek is also not set correctly. Check your code where you load the table and the following peek().&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 07:55:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388748#M613582</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-08-28T07:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cryptic error message: Syntax error</title>
      <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388749#M613583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Put an &lt;SPAN style="font-family: 'courier new', courier;"&gt;exit;&lt;/SPAN&gt; statement after your vWeek assignment statement, and rerun your script. The script will stop at the exit statement which should work ok and give you a chance to inspect the different elements that (should) lead to a correct vWeek value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Settings-&amp;gt;Variable Overview to check the contents of variable vWeek. It will either be empty or non-existant.&lt;/P&gt;&lt;P&gt;That means that the assignment didn't work or couldn't find any data in column GB_Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Start the table viewer by pressing Ctrl-T, right click table Table_Week and select "Preview". Does this table contain any data at all? If not, you know where to start fixing your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2017 09:35:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388749#M613583</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-08-28T09:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cryptic error message: Syntax error</title>
      <link>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388750#M613584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your input, yes, there is an error in how I'm setting the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Aug 2017 17:39:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cryptic-error-message-Syntax-error/m-p/1388750#M613584</guid>
      <dc:creator>julioarriaga</dc:creator>
      <dc:date>2017-08-29T17:39:52Z</dc:date>
    </item>
  </channel>
</rss>

