<?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 Qlik Variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlik-Variable/m-p/1694844#M53141</link>
    <description>&lt;P&gt;Hello.&lt;BR /&gt;&lt;BR /&gt;I have got an app which has a SQL Select query to select fields and populate a table for a report.&lt;/P&gt;&lt;P&gt;For the front page of the NPrinting report, I need to create a variable for the max date for a specific field. However, I do not know how to create a variable using SQL script.&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL select dp.Number&lt;BR /&gt;,dp.InceptionDate&lt;BR /&gt;,dp.EffectiveDate&lt;BR /&gt;,dp.ExpiryDate&lt;BR /&gt;,dp.CancellationDate&lt;BR /&gt;,datediff(year,dp.InceptionDate,dp.EffectiveDate) as TermNumber&lt;BR /&gt;,dlob.LobCd&lt;BR /&gt;,dlob.LobDesc&lt;BR /&gt;,SUM(fp.GWP) AS GrossWrittenPremium&lt;BR /&gt;,SUM(fp.NWP) AS NetWrittenPremium&lt;BR /&gt;,SUM(fp.Commission) AS Commission&lt;/P&gt;&lt;P&gt;from [GBQPS1SDA01DMA].[cdm].[FactPrm] fp&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[DLOB] dlob on fp.FKLineOfBusinessOID = dlob.LineOfBusinessOID&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[Dim] dp on fp.FKOID = dp.OID&lt;BR /&gt;and dp.CurrentRecordIndicator = '1'&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[DIMPrT] dpt on fp.FKTrOID = dpt.PrmTOID&lt;BR /&gt;and dpt.CurrentRecordIndicator = '1'&lt;/P&gt;&lt;P&gt;where 1=1&lt;BR /&gt;and dlob.LobCd IN ('B0100', 'B0098', 'B0099')&lt;BR /&gt;AND dp.EffectiveDate = dp.ExpiryDate&lt;/P&gt;&lt;P&gt;GROUP BY dp.Number&lt;BR /&gt;,dp.InceptionDate&lt;BR /&gt;,dp.EffectiveDate&lt;BR /&gt;,dp.ExpiryDate&lt;BR /&gt;,dp.CancellationDate&lt;BR /&gt;,datediff(year,dp.InceptionDate,dp.EffectiveDate)&lt;BR /&gt;,dlob.LobCd&lt;BR /&gt;,dlob.LobDesc&lt;BR /&gt;HAVING SUM(fp.GWP) &amp;lt;&amp;gt; 0;&lt;/P&gt;&lt;P&gt;exit script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to create a variable to pass through to NPrinting which gives me the Max value of EffectiveDate, so essentially;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let vDateTO = Date(Max([dp.EffectiveDate],'DD-MM-YYYY')); - however this seems to not work,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 18:45:52 GMT</pubDate>
    <dc:creator>QlikBeginner1</dc:creator>
    <dc:date>2024-11-16T18:45:52Z</dc:date>
    <item>
      <title>Qlik Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Variable/m-p/1694844#M53141</link>
      <description>&lt;P&gt;Hello.&lt;BR /&gt;&lt;BR /&gt;I have got an app which has a SQL Select query to select fields and populate a table for a report.&lt;/P&gt;&lt;P&gt;For the front page of the NPrinting report, I need to create a variable for the max date for a specific field. However, I do not know how to create a variable using SQL script.&lt;/P&gt;&lt;P&gt;Load*;&lt;/P&gt;&lt;P&gt;SQL select dp.Number&lt;BR /&gt;,dp.InceptionDate&lt;BR /&gt;,dp.EffectiveDate&lt;BR /&gt;,dp.ExpiryDate&lt;BR /&gt;,dp.CancellationDate&lt;BR /&gt;,datediff(year,dp.InceptionDate,dp.EffectiveDate) as TermNumber&lt;BR /&gt;,dlob.LobCd&lt;BR /&gt;,dlob.LobDesc&lt;BR /&gt;,SUM(fp.GWP) AS GrossWrittenPremium&lt;BR /&gt;,SUM(fp.NWP) AS NetWrittenPremium&lt;BR /&gt;,SUM(fp.Commission) AS Commission&lt;/P&gt;&lt;P&gt;from [GBQPS1SDA01DMA].[cdm].[FactPrm] fp&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[DLOB] dlob on fp.FKLineOfBusinessOID = dlob.LineOfBusinessOID&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[Dim] dp on fp.FKOID = dp.OID&lt;BR /&gt;and dp.CurrentRecordIndicator = '1'&lt;BR /&gt;join [GBQPS1SDA01DMA].[cdm].[DIMPrT] dpt on fp.FKTrOID = dpt.PrmTOID&lt;BR /&gt;and dpt.CurrentRecordIndicator = '1'&lt;/P&gt;&lt;P&gt;where 1=1&lt;BR /&gt;and dlob.LobCd IN ('B0100', 'B0098', 'B0099')&lt;BR /&gt;AND dp.EffectiveDate = dp.ExpiryDate&lt;/P&gt;&lt;P&gt;GROUP BY dp.Number&lt;BR /&gt;,dp.InceptionDate&lt;BR /&gt;,dp.EffectiveDate&lt;BR /&gt;,dp.ExpiryDate&lt;BR /&gt;,dp.CancellationDate&lt;BR /&gt;,datediff(year,dp.InceptionDate,dp.EffectiveDate)&lt;BR /&gt;,dlob.LobCd&lt;BR /&gt;,dlob.LobDesc&lt;BR /&gt;HAVING SUM(fp.GWP) &amp;lt;&amp;gt; 0;&lt;/P&gt;&lt;P&gt;exit script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to create a variable to pass through to NPrinting which gives me the Max value of EffectiveDate, so essentially;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let vDateTO = Date(Max([dp.EffectiveDate],'DD-MM-YYYY')); - however this seems to not work,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Variable/m-p/1694844#M53141</guid>
      <dc:creator>QlikBeginner1</dc:creator>
      <dc:date>2024-11-16T18:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Qlik-Variable/m-p/1694896#M53146</link>
      <description>&lt;P&gt;Is this something that is not achievable in Qlik Sense? This was a quick and urgent request which was why its being loaded via a SQL query. using this :&amp;nbsp;&lt;SPAN&gt;Let vDateTO = Date(Max([dp.EffectiveDate],'DD-MM-YYYY'));&amp;nbsp; does not error the app from loading, however I am unable to see the variable in the list of variables? However if i include that in a measure in the front end, I can see the value of the date I want..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance experts!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 12:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlik-Variable/m-p/1694896#M53146</guid>
      <dc:creator>QlikBeginner1</dc:creator>
      <dc:date>2020-04-20T12:03:05Z</dc:date>
    </item>
  </channel>
</rss>

