<?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: transform formula to script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545605#M39307</link>
    <description>&lt;P&gt;A front end expression is evaluated in some context - for example, a text object (no dimensions), a table (with some set of dimensions), and so on. To evaluate this in script, you would need to understand this context.&lt;/P&gt;&lt;P&gt;You can use a pattern like this:&lt;/P&gt;&lt;PRE&gt;T_Max: 
LOAD MAX(KARFECHA) as maxFecha
Resident ...

Let vMaxFecha = Peek('maxFecha');

...

Fact2:
LOAD ...
	Sum(If(KARFECHA &amp;lt;= $(vMaxFecha), Cantidad_Saldo)) as Result,
	...
Resident ...
Group by ...
	
...
	
Set vMaxFecha =;	
DROP Table T_Max;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Feb 2019 05:27:56 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2019-02-18T05:27:56Z</dc:date>
    <item>
      <title>transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545451#M39297</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Help me please!!!!..... I want to put this expression&amp;nbsp;into the script.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sum({&amp;lt;KARFECHA={"&amp;lt;=$('$(=MAX(KARFECHA))')"}&amp;gt;} Cantidad_Saldo)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Feb 2019 18:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545451#M39297</guid>
      <dc:creator>olguita2014</dc:creator>
      <dc:date>2019-02-16T18:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545452#M39298</link>
      <description>&lt;P&gt;May be try below not sure if this is works, if not can you send some sample data with and example output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD *&lt;BR /&gt;FROM Tablename;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;BR /&gt;MaxLoad:&lt;BR /&gt;LOAD DimKeyField,&lt;BR /&gt;IF(KARFECHA &amp;lt;= Max(KARFECHA), Cantidad_Saldo) AS CantidFlow_Flag&lt;BR /&gt;Resident YouractualTable&lt;BR /&gt;Group By DimKeyField;&lt;/P&gt;&lt;P&gt;LEFT JOIN(MaxLoad)&lt;/P&gt;&lt;P&gt;LOAD DimKeyField,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sum(CantidFlow_Flag) AS SumField&lt;/P&gt;&lt;P&gt;Resident MaxLoad&lt;/P&gt;&lt;P&gt;Group By DimKeyField;&lt;/P&gt;&lt;P&gt;Left Join(YouractualTable)&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;resident MaxLoad;&lt;/P&gt;&lt;P&gt;Drop Table MaxLoad;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Feb 2019 18:24:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545452#M39298</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2019-02-16T18:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545580#M39302</link>
      <description>&lt;P&gt;Qlik preferred to use in Design level logic, If too luck complexity involved !! What is the purpose, you are going to back to the script Instead in Design?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 04:06:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545580#M39302</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-02-18T04:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545605#M39307</link>
      <description>&lt;P&gt;A front end expression is evaluated in some context - for example, a text object (no dimensions), a table (with some set of dimensions), and so on. To evaluate this in script, you would need to understand this context.&lt;/P&gt;&lt;P&gt;You can use a pattern like this:&lt;/P&gt;&lt;PRE&gt;T_Max: 
LOAD MAX(KARFECHA) as maxFecha
Resident ...

Let vMaxFecha = Peek('maxFecha');

...

Fact2:
LOAD ...
	Sum(If(KARFECHA &amp;lt;= $(vMaxFecha), Cantidad_Saldo)) as Result,
	...
Resident ...
Group by ...
	
...
	
Set vMaxFecha =;	
DROP Table T_Max;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Feb 2019 05:27:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1545605#M39307</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-02-18T05:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1546065#M39329</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;I have a problem, the sum is not performing correctly for all dates:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;VEHCHASIS&lt;/TD&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;TD&gt;MVESUFIJO&lt;/TD&gt;&lt;TD&gt;=Aggr(Sum(Cantidad_Saldo),VEHCHASIS)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JTMZD9EV6E5014970&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JTMZF9EV1ED022040&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JTDKD3B35F1567880&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5YFBU9HE7FP142104&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4T1BB3EK0AU118666&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;AA&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The actual values are those of the last column&lt;/P&gt;</description>
      <pubDate>Mon, 18 Feb 2019 22:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1546065#M39329</guid>
      <dc:creator>olguita2014</dc:creator>
      <dc:date>2019-02-18T22:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: transform formula to script</title>
      <link>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1546071#M39330</link>
      <description>Hi,&lt;BR /&gt;My script is and the results are ok:&lt;BR /&gt;VEH_KARDEX:&lt;BR /&gt;LOAD&lt;BR /&gt;Clave_CompraDetalle_Kardex_Vehiculo,&lt;BR /&gt;Numero_Fecha_Kardex,&lt;BR /&gt;KarAño,&lt;BR /&gt;KarMes,&lt;BR /&gt;KarDia,&lt;BR /&gt;Cantidad_Saldo,&lt;BR /&gt;Clave_Agencia_Kardex,&lt;BR /&gt;Codigo_Agencia,&lt;BR /&gt;Fecha_Fin_Kardex,&lt;BR /&gt;KARFECHA,&lt;BR /&gt;KARHORA,&lt;BR /&gt;KARVALORVEHI,&lt;BR /&gt;KARAGECODIDEST,&lt;BR /&gt;KARSIGNO,&lt;BR /&gt;KARNUMEROMOVIMIENTO,&lt;BR /&gt;TITCODIGO,&lt;BR /&gt;KARESTADO,&lt;BR /&gt;KARUSUARIOCREA,&lt;BR /&gt;KARFECHACREA,&lt;BR /&gt;KARUSUARIOMODIFICA,&lt;BR /&gt;KARFECHAMODIFICA,&lt;BR /&gt;LIVCODIGO&lt;BR /&gt;FROM [lib://QVDs/VEH_KARDEX_TMP.qvd]&lt;BR /&gt;(qvd)&lt;BR /&gt;Where NOT IsNull(KARFECHA);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Rango_Fechas_Kardex_Tmp:&lt;BR /&gt;Load Distinct&lt;BR /&gt;'31/12/2005' as Fecha_Inicio_Kardex,Fecha_Fin_Kardex as Fecha_Kardex&lt;BR /&gt;Resident VEH_KARDEX;&lt;BR /&gt;Inner Join IntervalMatch (Fecha_Fin_Kardex)&lt;BR /&gt;Load Distinct Fecha_Inicio_Kardex,Fecha_Kardex&lt;BR /&gt;Resident Rango_Fechas_Kardex_Tmp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Fact2:&lt;BR /&gt;Load&lt;BR /&gt;Clave_CompraDetalle_Kardex_Vehiculo,&lt;BR /&gt;Fecha_Fin_Kardex,&lt;BR /&gt;Cantidad_Saldo&lt;BR /&gt;Resident VEH_KARDEX;&lt;BR /&gt;Join&lt;BR /&gt;Load Fecha_Fin_Kardex,&lt;BR /&gt;Fecha_Kardex&lt;BR /&gt;Resident Rango_Fechas_Kardex_Tmp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;Fact3:&lt;BR /&gt;LOAD&lt;BR /&gt;Clave_CompraDetalle_Kardex_Vehiculo,&lt;BR /&gt;Sum(Cantidad_Saldo) as Result&lt;BR /&gt;Resident Fact2&lt;BR /&gt;Group by Clave_CompraDetalle_Kardex_Vehiculo, Fecha_Kardex;&lt;BR /&gt;Drop Table Fact2;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But the time of performance of Qlik is bad.&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Feb 2019 23:11:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/transform-formula-to-script/m-p/1546071#M39330</guid>
      <dc:creator>olguita2014</dc:creator>
      <dc:date>2019-02-18T23:11:22Z</dc:date>
    </item>
  </channel>
</rss>

