<?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 Create a field on initial script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317280#M1200951</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your script should look something like this:&lt;/P&gt;&lt;P&gt;MappingLoadTableName:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;FieldThatLinksVentaToTableBelow,&lt;BR /&gt;Venta&lt;BR /&gt;From Wherever;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;BR /&gt;LOAD *,&lt;BR /&gt;&lt;BR /&gt;IF([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) as Rotación,&lt;BR /&gt;&lt;BR /&gt;IF([Qtà stk. val.]=0,'No Valorable',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 10,'Stock Insuficiente',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 3 and Venta/[Qtà stk. val.] &amp;lt;= 10, 'Correcto',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 1 and Venta/[Qtà stk. val.] &amp;lt;= 3,'Stock Elevado',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;=0.25 and Venta/[Qtà stk. val.] &amp;lt;= 1,'Rotación Defectuosa',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 0 and Venta/[Qtà stk. val.] &amp;lt;= 0.25, 'Rotación Muy Defectuosa','No Valorable')))))) as [Situación Stock];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LOAD Año,&lt;BR /&gt;&lt;BR /&gt;applymap('MappingLoadTableName', FieldThatLinksVentaToTableBelow, 0) as Venta,&lt;BR /&gt;&lt;BR /&gt; Mes,&lt;BR /&gt;&lt;BR /&gt; Materiale,&lt;BR /&gt;&lt;BR /&gt; [Qtà stk. val.],&lt;BR /&gt;&lt;BR /&gt; [Valore stk. v.],&lt;BR /&gt;&lt;BR /&gt; [tarifa almacenaje],&lt;BR /&gt;&lt;BR /&gt; [tarifa manipulación],&lt;BR /&gt;&lt;BR /&gt; [Coste standard]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;BR /&gt; &lt;O&gt;&lt;BR /&gt;&lt;BR /&gt; (ooxml, embedded labels, table is [Inventario mes]);&lt;/O&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Mar 2011 13:16:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-30T13:16:33Z</dc:date>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317277#M1200948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to create a field on the initial script using two fields from two different files.&lt;/P&gt;&lt;P&gt;a part of my script looks like this:&lt;/P&gt;&lt;P&gt;&lt;B&gt;LOAD&lt;/B&gt; Año,&lt;/P&gt;&lt;P&gt;Mes,&lt;/P&gt;&lt;P&gt;Materiale,&lt;/P&gt;&lt;P&gt;[Qtà stk. val.],&lt;/P&gt;&lt;P&gt;[Valore stk. v.],&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&amp;gt;&lt;/STRONG&gt;IF([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) &lt;B&gt;as&lt;/B&gt; Rotación,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&amp;gt;&lt;/STRONG&gt;IF([Qtà stk. val.]=0,'No Valorable',&lt;/P&gt;&lt;P&gt;IF(Venta/[Qtà stk. val.] &amp;gt;= 10,'Stock Insuficiente',&lt;/P&gt;&lt;P&gt;IF(Venta/[Qtà stk. val.] &amp;gt;= 3 &lt;B&gt;and&lt;/B&gt; Venta/[Qtà stk. val.] &amp;lt;= 10, 'Correcto',&lt;/P&gt;&lt;P&gt;IF(Venta/[Qtà stk. val.] &amp;gt;= 1 &lt;B&gt;and&lt;/B&gt; Venta/[Qtà stk. val.] &amp;lt;= 3,'Stock Elevado',&lt;/P&gt;&lt;P&gt;IF(Venta/[Qtà stk. val.] &amp;gt;=0.25 &lt;B&gt;and&lt;/B&gt; Venta/[Qtà stk. val.] &amp;lt;= 1,'Rotación Defectuosa',&lt;/P&gt;&lt;P&gt;IF(Venta/[Qtà stk. val.] &amp;gt;= 0 &lt;B&gt;and&lt;/B&gt; Venta/[Qtà stk. val.] &amp;lt;= 0.25, 'Rotación Muy Defectuosa','No Valorable')))))) &lt;B&gt;as&lt;/B&gt; [Situación Stock],&lt;/P&gt;&lt;P&gt;[tarifa almacenaje],&lt;/P&gt;&lt;P&gt;[tarifa manipulación],&lt;/P&gt;&lt;P&gt;[Coste standard]&lt;/P&gt;&lt;P style="font-weight: bold"&gt;FROM&lt;/P&gt;&lt;P&gt;&lt;O&gt;&lt;/O&gt;&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [Inventario mes]);&lt;/P&gt;&lt;P&gt;The problem is that the field Venta comes from another file so the script gives an error.&lt;/P&gt;&lt;P&gt;How can i do to create the field on the initial script using two fields loaded from two different files?&lt;/P&gt;&lt;P&gt;Thanks for your time!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 13:07:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317277#M1200948</guid>
      <dc:creator />
      <dc:date>2011-03-30T13:07:23Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317278#M1200949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does Venta have a matching value in this table? If yes, you can use the mapping load technique to load the Venta into this table and then a preceding load technique for those if-statements.&lt;/P&gt;&lt;P&gt;Do you need more info on mapping loads and preceding load technique. Mapping load is the same as an Excel vlookup.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 13:11:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317278#M1200949</guid>
      <dc:creator />
      <dc:date>2011-03-30T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317279#M1200950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't really know how to use mappingload techniques, could you expain me or link me somewhere so i can check it?&lt;/P&gt;&lt;P&gt;Thanks for your time!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 13:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317279#M1200950</guid>
      <dc:creator />
      <dc:date>2011-03-30T13:15:33Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317280#M1200951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your script should look something like this:&lt;/P&gt;&lt;P&gt;MappingLoadTableName:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;FieldThatLinksVentaToTableBelow,&lt;BR /&gt;Venta&lt;BR /&gt;From Wherever;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalTable:&lt;BR /&gt;LOAD *,&lt;BR /&gt;&lt;BR /&gt;IF([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) as Rotación,&lt;BR /&gt;&lt;BR /&gt;IF([Qtà stk. val.]=0,'No Valorable',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 10,'Stock Insuficiente',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 3 and Venta/[Qtà stk. val.] &amp;lt;= 10, 'Correcto',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 1 and Venta/[Qtà stk. val.] &amp;lt;= 3,'Stock Elevado',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;=0.25 and Venta/[Qtà stk. val.] &amp;lt;= 1,'Rotación Defectuosa',&lt;BR /&gt;&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 0 and Venta/[Qtà stk. val.] &amp;lt;= 0.25, 'Rotación Muy Defectuosa','No Valorable')))))) as [Situación Stock];&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;LOAD Año,&lt;BR /&gt;&lt;BR /&gt;applymap('MappingLoadTableName', FieldThatLinksVentaToTableBelow, 0) as Venta,&lt;BR /&gt;&lt;BR /&gt; Mes,&lt;BR /&gt;&lt;BR /&gt; Materiale,&lt;BR /&gt;&lt;BR /&gt; [Qtà stk. val.],&lt;BR /&gt;&lt;BR /&gt; [Valore stk. v.],&lt;BR /&gt;&lt;BR /&gt; [tarifa almacenaje],&lt;BR /&gt;&lt;BR /&gt; [tarifa manipulación],&lt;BR /&gt;&lt;BR /&gt; [Coste standard]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;&lt;BR /&gt; &lt;O&gt;&lt;BR /&gt;&lt;BR /&gt; (ooxml, embedded labels, table is [Inventario mes]);&lt;/O&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 13:16:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317280#M1200951</guid>
      <dc:creator />
      <dc:date>2011-03-30T13:16:33Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317281#M1200952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Hi,&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;I really didn't understand the mapping load procedure.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;In the first file I am loading, the sales evolution for every material, I have three fields which I will use:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;Materiale, Venta and two calculated fields called Año and Mes.&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;On the second file I load, the inventory file, I have:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;Año, Mes, Materiale and [Qtà stk. val.] (Amount of product in the inventory that month)&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;My purpose is that when Año, Mes and Materiale Match in both files, create a new column called "Rotación" that looks like:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;IF([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) &lt;B&gt;as&lt;/B&gt; Rotación,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;line-height:normal;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;This procedure is to avoid taking the sales to the inventory file and then calculating the rotación.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;I would introduce the formula as an expression inside the object, but i will need this field (Rotación) for few pages and i prefer not to copy the expression every time i need it.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;I hope I have expressed myself better this time.&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Thanks very much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 14:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317281#M1200952</guid>
      <dc:creator />
      <dc:date>2011-03-30T14:30:49Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317282#M1200953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah ok.&lt;/P&gt;&lt;P&gt;An applymap is the same as an Excel vlookup. So let us say I have a Product table with ProductID and ProductPrice and I have a Sales table with ProductID and QuantitySold, I might want to find SalesValue such as ProductPrice * QuantitySold within the SalesTable. The problem in this case example is that ProductPrice is in Product table and I need it in the Sales table.&lt;/P&gt;&lt;P&gt;In this case, I can return the ProductPrice in the Sales table via an applymap. Such as&lt;/P&gt;&lt;P&gt;MappingPriceTable:&lt;/P&gt;&lt;P&gt;ProductID, ProductPrice&lt;/P&gt;&lt;P&gt;From Product;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SalesTable:&lt;/P&gt;&lt;P&gt;applymap('MappingPriceTable', ProductID, 0) * QuantitySold as SalesValue,&lt;/P&gt;&lt;P&gt;etc.,&lt;/P&gt;&lt;P&gt;etc.,&lt;/P&gt;&lt;P&gt;From Sales;&lt;/P&gt;&lt;P&gt;What I understand of what you are trying to do is a comparison of values between 2 tables. When the values are the same in Table1 and Table2, then calculate something else. Is this right?&lt;/P&gt;&lt;P&gt;If you are trying to do this then the exists function would be useful.&lt;/P&gt;&lt;P&gt;exists(X, Y) does a comparison of values in Field X and values in Field Y. When the condition is fulfilled (when there is a match), QV returns a Boolean of -1 and when the condition is not fulfilled it returns zero.&lt;/P&gt;&lt;P&gt;Hence, I think you want to load a concatenated field in your first table, such as:&lt;/P&gt;&lt;P&gt;Año &amp;amp; Mes &amp;amp; Materiale as Matchingfield, etc...&lt;/P&gt;&lt;P&gt;And in the second table do a preceding load statement such as:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;if(MatchingField = -1, then EXPRESSION, 0) as Rotacion;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Año &amp;amp; Mes &amp;amp; Materiale as Matchingfield,&lt;/P&gt;&lt;P&gt;OriginalField,&lt;/P&gt;&lt;P&gt;NextOriginalField,&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Does this make sense. If no, can you give a text file with the script of BOTH tables?&lt;/P&gt;&lt;P&gt;L&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 15:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317282#M1200953</guid>
      <dc:creator />
      <dc:date>2011-03-30T15:01:14Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317283#M1200954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry mistake:&lt;/P&gt;&lt;P&gt;This is your load statement:&lt;/P&gt;&lt;P&gt;Table one add one field, such as:&lt;/P&gt;&lt;P&gt;Año &amp;amp; Mes &amp;amp; Materiale as Matchingfield1, etc...&lt;/P&gt;&lt;P&gt;And in the second table add this:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;if(MatchingField = -1, then EXPRESSION, 0) as Rotacion;&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;exists(MatchingField1, MatchingField2) as MatchingField;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Año &amp;amp; Mes &amp;amp; Materiale as Matchingfield2,&lt;/P&gt;&lt;P&gt;OriginalField,&lt;/P&gt;&lt;P&gt;NextOriginalField,&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 15:05:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317283#M1200954</guid>
      <dc:creator />
      <dc:date>2011-03-30T15:05:23Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317284#M1200955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My complete script is as follows,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; Materiale,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'GEN*'), 'Enero',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'FEB*'), 'Febrero',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'MAR*'), 'Marzo',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'APR*'), 'Abril',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'MAG*'), 'Mayo',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'GIU*'), 'Junio',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'LUG*'), 'Julio',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'AGO*'), 'Agosto',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'SET*'), 'Septiembre',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'OTT*'), 'Octubre',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'NOV*'), 'Noviembre',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'DIC*'), 'Diciembre','ERROR')))))))))))) &lt;B&gt;as&lt;/B&gt; Mes,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*200*') &lt;B&gt;or&lt;/B&gt; WildMatch([Anno cal./mese],'*199*'),'Antiguo',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*2010'),'2010',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*2011'),'2011',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*2012'),'2012',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*2013'),'2013', IF(WildMatch([Anno cal./mese],'*2014'),'2014',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF(WildMatch([Anno cal./mese],'*2015'),'2015','Actualizar Scrpit'))))))) &lt;B&gt;as&lt;/B&gt; Año,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Quantità PF] &lt;B&gt;as&lt;/B&gt; Venta&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;FROM&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;O&gt;&lt;/O&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;(biff, embedded labels, table is Hoja1$);&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; Materiale,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;BL,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Nombre Materiale],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Tarifa Almacenaje (€/m3)],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;SM &lt;B&gt;as&lt;/B&gt; SITUACIÓN,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Familia,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[volume M3],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=10 &lt;B&gt;AND&lt;/B&gt; Familia &amp;lt;&amp;gt; 99), 'AQS',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=10 &lt;B&gt;AND&lt;/B&gt; Familia = 99), 'AQS ACC',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=40 &lt;B&gt;AND&lt;/B&gt; Familia &amp;lt;&amp;gt; 99), 'CAL',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=40 &lt;B&gt;AND&lt;/B&gt; Familia = 99), 'CAL ACC',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=85 &lt;B&gt;AND&lt;/B&gt; Familia &amp;lt;&amp;gt; 99), 'RIN',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;IF((BL=85 &lt;B&gt;AND&lt;/B&gt; Familia = 99), 'RIN ACC','OTROS')))))) &lt;B&gt;as&lt;/B&gt; Clasificación&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;FROM&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;O&gt;&lt;/O&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;(ooxml, embedded labels, table is [Datos Materiales]);&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;LOAD&lt;/B&gt; Año,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Mes,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Materiale,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Qtà stk. val.],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Valore stk. v.],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[tarifa almacenaje],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[tarifa manipulación],&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;[Coste standard]&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;&lt;/P&gt;&lt;P style="font-weight: bold; margin: 0cm 0cm 0pt; mso-layout-grid-align: none"&gt;FROM&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;O&gt;&lt;/O&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;(ooxml, embedded labels, table is [Inventario mes]);&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;This is the expressions i want to introduce:&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;"&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) as Rotación,&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;([Qtà stk. val.]=0,'No Valorable',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;(Venta/[Qtà stk. val.] &amp;gt;= 10,'Stock Insuficiente',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;(Venta/[Qtà stk. val.] &amp;gt;= 3 and Venta/[Qtà stk. val.] &amp;lt;= 10, 'Correcto',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;(Venta/[Qtà stk. val.] &amp;gt;= 1 and Venta/[Qtà stk. val.] &amp;lt;= 3,'Stock Elevado',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;(Venta/[Qtà stk. val.] &amp;gt;=0.25 and Venta/[Qtà stk. val.] &amp;lt;= 1,'Rotación Defectuosa',&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;B&gt;IF&lt;/B&gt;(Venta/[Qtà stk. val.] &amp;gt;= 0 and Venta/[Qtà stk. val.] &amp;lt;= 0.25, 'Rotación Muy Defectuosa','No Valorable')))))) as [Situación Stock], "&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 0pt;mso-layout-grid-align:none;"&gt;Hope this helps!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 15:23:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317284#M1200955</guid>
      <dc:creator />
      <dc:date>2011-03-30T15:23:19Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317285#M1200956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;It's difficult giving you a scripting technique that will universally work, especially when we are talking theory as I don't know what your underlying data structure is, but I think you might be trying something along the lines of this. Can you test this script? Tell me if it works at least and it returns the values you want. Then maybe it might be easier to explain the scripting techniques, as there are different ways around this. I am writing the script without knowing the amount of rows you are loading, content &amp;amp; cardinality of data, hence I cannot ensure that this script is optimally written, but I think it will generate the numbers you are looking for. Let me know.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hoja:&lt;BR /&gt;LOAD *,&lt;BR /&gt; Año &amp;amp; Mes &amp;amp; Materiale as LinkField;&lt;BR /&gt;LOAD&lt;BR /&gt; Materiale,&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'GEN*'), 'Enero',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'FEB*'), 'Febrero',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'MAR*'), 'Marzo',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'APR*'), 'Abril',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'MAG*'), 'Mayo',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'GIU*'), 'Junio',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'LUG*'), 'Julio',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'AGO*'), 'Agosto',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'SET*'), 'Septiembre',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'OTT*'), 'Octubre',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'NOV*'), 'Noviembre',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'DIC*'), 'Diciembre','ERROR')))))))))))) as Mes,&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*200*') or WildMatch([Anno cal./mese],'*199*'),'Antiguo',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*2010'),'2010',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*2011'),'2011',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*2012'),'2012',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*2013'),'2013', IF(WildMatch([Anno cal./mese],'*2014'),'2014',&lt;BR /&gt; IF(WildMatch([Anno cal./mese],'*2015'),'2015','Actualizar Scrpit'))))))) as Año,&lt;BR /&gt; [Quantità PF] as Venta&lt;BR /&gt;FROM&lt;BR /&gt; &lt;O&gt;&lt;BR /&gt; (biff, embedded labels, table is Hoja1$);&lt;BR /&gt;&lt;BR /&gt;Venta_Map:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt; LinkField,&lt;BR /&gt; Venta&lt;BR /&gt;Resident Hoja;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;DatosMateriales:&lt;BR /&gt;LOAD Materiale,&lt;BR /&gt; BL,&lt;BR /&gt; [Nombre Materiale],&lt;BR /&gt; [Tarifa Almacenaje (€/m3)],&lt;BR /&gt; SM as SITUACIÓN,&lt;BR /&gt; Familia,&lt;BR /&gt; [volume M3],&lt;BR /&gt; IF((BL=10 AND Familia &amp;lt;&amp;gt; 99), 'AQS',&lt;BR /&gt; IF((BL=10 AND Familia = 99), 'AQS ACC',&lt;BR /&gt; IF((BL=40 AND Familia &amp;lt;&amp;gt; 99), 'CAL',&lt;BR /&gt; IF((BL=40 AND Familia = 99), 'CAL ACC',&lt;BR /&gt; IF((BL=85 AND Familia &amp;lt;&amp;gt; 99), 'RIN',&lt;BR /&gt; IF((BL=85 AND Familia = 99), 'RIN ACC','OTROS')))))) as Clasificación&lt;BR /&gt;FROM&lt;BR /&gt; &lt;O&gt;&lt;BR /&gt; (ooxml, embedded labels, table is [Datos Materiales]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;InventarioMes_Temp:&lt;BR /&gt;LOAD Año,&lt;BR /&gt; Mes,&lt;BR /&gt; Materiale,&lt;BR /&gt; Año &amp;amp; Mes &amp;amp; Materiale as LinkField,&lt;BR /&gt; [Qtà stk. val.],&lt;BR /&gt; [Valore stk. v.],&lt;BR /&gt; [tarifa almacenaje],&lt;BR /&gt; [tarifa manipulación],&lt;BR /&gt; [Coste standard]&lt;BR /&gt;FROM&lt;BR /&gt; &lt;O&gt;&lt;BR /&gt; (ooxml, embedded labels, table is [Inventario mes]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;InventarioMes:&lt;BR /&gt;LOAD&lt;BR /&gt; *,&lt;BR /&gt; IF([Qtà stk. val.]=0,'INF',Venta/[Qtà stk. val.]) as Rotación,&lt;BR /&gt; IF([Qtà stk. val.]=0,'No Valorable',&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 10,'Stock Insuficiente',&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 3 and Venta/[Qtà stk. val.] &amp;lt;= 10, 'Correcto',&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 1 and Venta/[Qtà stk. val.] &amp;lt;= 3,'Stock Elevado',&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;=0.25 and Venta/[Qtà stk. val.] &amp;lt;= 1,'Rotación Defectuosa',&lt;BR /&gt; IF(Venta/[Qtà stk. val.] &amp;gt;= 0 and Venta/[Qtà stk. val.] &amp;lt;= 0.25, 'Rotación Muy Defectuosa','No Valorable')))))) as [Situación Stock]&lt;BR /&gt; ;&lt;BR /&gt;LOAD&lt;BR /&gt; *,&lt;BR /&gt; applymap('Venta_Map', LinkField, 0) as Venta&lt;BR /&gt;Resident InventarioMes_Temp;&lt;BR /&gt;&lt;BR /&gt;drop table InventarioMes_Temp;&lt;/O&gt;&lt;/O&gt;&lt;/O&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 16:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317285#M1200956</guid>
      <dc:creator />
      <dc:date>2011-03-30T16:14:43Z</dc:date>
    </item>
    <item>
      <title>Create a field on initial script</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317286#M1200957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've just tried the script and it doesn't work. It gives two values for every Materiale, Año &amp;amp; Mes. The Values are allways "-" &amp;amp; "0", as you can observe on the image below.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/674/3782.ImageQlik.jpg"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/674/3782.ImageQlik.jpg" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As you can see, the script has separated the values of Cantidad &amp;amp; Venta for each materiale in two different registers. I imagine that is why "Rotación" gets only values "-" &amp;amp;"0".&lt;/P&gt;&lt;P&gt;I don't really know where the problem is in the script...&lt;/P&gt;&lt;P&gt;Anyway, thanks for trying!!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2011 13:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-field-on-initial-script/m-p/317286#M1200957</guid>
      <dc:creator />
      <dc:date>2011-03-31T13:24:27Z</dc:date>
    </item>
  </channel>
</rss>

