<?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: Prob in understanding the below script !! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821253#M1036276</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;Dual() returns a field value that has two identities, a string version (for display) and a numerical version (for caluclation). FiscalMonth contains the month number in the fiscal year. For example, if your FiscalYear starts on April 1st, then for May FiscalMonth will be 2.&lt;/LI&gt;&lt;LI&gt;Returns a dual value with a regular month name and a FiscalMonth value. E;g. ('May', 2) in my previous example. Date is a generated date value. See the first (bottom) LOAD statement from the PRECEDING LOAD.&lt;/LI&gt;&lt;LI&gt;RowNum contains the current row number. Peek('RowNum') returns the row number of the previous row we processed. This is an overly complex way to generate increasing numbers. Better do this with RowNo().&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Jan 2015 09:48:22 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-01-06T09:48:22Z</dc:date>
    <item>
      <title>Prob in understanding the below script !!</title>
      <link>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821251#M1036274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Hey,&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;I didn't get some of the statements in below script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;1)&amp;nbsp; What does&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3) return ?? And is value for &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;FiscalMonth = 12 ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;2) What does&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth)&amp;nbsp; return ?? and int he function&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;MonthEnd(Date)&amp;nbsp; does Date is the current date ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;3) What does&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Date returns ?? and What is the value of&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;'RowNum' ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Can you explain please ??&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;Thanks&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;----------&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SET vFiscalYearStartMonth = 4;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vStartDate = Num(YearStart(Today(), -1));&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vEndDate = Num(YearEnd(Today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FiscalCalendar:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;*,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;*,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Year(Date) AS Year, // Standard Calendar Year&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Month(Date) AS Month, // Standard Calendar Month&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Date(MonthEnd(Date), 'MMM') AS MonthName,&amp;nbsp; // Standard Calendar Month Name&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Dual('Q' &amp;amp; Ceil(Month(Date)/3), Ceil(Month(Date)/3)) AS Quarter,&amp;nbsp; // Standard Calendar Quarter&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Mod(Month(Date) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,&amp;nbsp; // Fiscal Calendar Month&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;YearName(Date, 0, $(vFiscalYearStartMonth)) AS FiscalYear;&amp;nbsp; // Fiscal Calendar Year&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Date,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;RangeSum(Peek('RowNum'), 1) AS RowNum&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;AutoGenerate vEndDate - vStartDate + 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 09:36:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821251#M1036274</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-06T09:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Prob in understanding the below script !!</title>
      <link>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821252#M1036275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;1)&amp;nbsp; What does&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3) return ?? And is value for &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;FiscalMonth = 12 ??&amp;nbsp; - This is to arrive the Quarter column with numeric value using Dual, the second parameter is a number, while sorting this is very useful, if we select Numeric in Sort tab it will sort accordingly.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;2) What does&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Dual(Text(Date(MonthEnd(Date), 'MMM')), FiscalMonth)&amp;nbsp; return ?? and int he function&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;MonthEnd(Date)&amp;nbsp; does Date is the current date ??&amp;nbsp;&amp;nbsp; - Date is the date field in the table, here the date is returned as a text in MMM format, and used dual function for sorting purpose.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;3) What does&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1) AS Date returns ?? and What is the value of&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'RowNum' ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1)&amp;nbsp;&amp;nbsp;&amp;nbsp; -- Here we are generating the dates vStartDate will have the starting calendar date and Peek will return the value of the previous record.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Hope this helps you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f6f6f6;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 09:46:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821252#M1036275</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-01-06T09:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Prob in understanding the below script !!</title>
      <link>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821253#M1036276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;Dual() returns a field value that has two identities, a string version (for display) and a numerical version (for caluclation). FiscalMonth contains the month number in the fiscal year. For example, if your FiscalYear starts on April 1st, then for May FiscalMonth will be 2.&lt;/LI&gt;&lt;LI&gt;Returns a dual value with a regular month name and a FiscalMonth value. E;g. ('May', 2) in my previous example. Date is a generated date value. See the first (bottom) LOAD statement from the PRECEDING LOAD.&lt;/LI&gt;&lt;LI&gt;RowNum contains the current row number. Peek('RowNum') returns the row number of the previous row we processed. This is an overly complex way to generate increasing numbers. Better do this with RowNo().&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Jan 2015 09:48:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Prob-in-understanding-the-below-script/m-p/821253#M1036276</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-06T09:48:22Z</dc:date>
    </item>
  </channel>
</rss>

