<?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 doubt in query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/doubt-in-query/m-p/1955567#M1219898</link>
    <description>&lt;P&gt;LET vDMNoOfYear =20;&lt;BR /&gt;Let vMaxDate = Floor(YearEnd(Today()-1));&amp;nbsp;&lt;BR /&gt;LET vMinDate = Floor(YearStart(AddYears(Today(), -($(vDMNoOfYear)))));&lt;/P&gt;
&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Year(CalDate) as Year,&lt;BR /&gt;WeekDay(CalDate) as WeekDay,&lt;BR /&gt;'Q' &amp;amp; Ceil(Month(CalDate)/3) as Quarter,&lt;BR /&gt;QuarterName(CalDate) as QuarterName,&lt;BR /&gt;Month(CalDate) as Month,&lt;BR /&gt;If(Month(CalDate) = Month(QuarterEnd(CalDate)), 1, 0) as MaxMonthFlag,&lt;BR /&gt;Date(MonthStart(CalDate), 'MM-YYYY') as MonthYear,&lt;BR /&gt;1000*Rand() as Sales;&lt;BR /&gt;LOAD&lt;BR /&gt;Date($(vMinDate) + IterNo()-1) as CalDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While $(vMinDate) + IterNo()-1 &amp;lt;= $(vMaxDate);&lt;/P&gt;
&lt;P&gt;LOAD QuarterName, Max(MonthYear) as MaxMonthYearPerQuarter Resident MasterCalendar Group by QuarterName;&lt;/P&gt;
&lt;P&gt;For i=5 to 20 step 5&lt;BR /&gt;Load Distinct Year, 'Last '&amp;amp; $(i) &amp;amp; ' Years' as LastNYearFlag Resident MasterCalendar&lt;BR /&gt;Where Year &amp;gt; Year(Today())-$(i);&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;o/p:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ha142000_0-1657779255803.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/84118i90B9C2FE91ABEF7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ha142000_0-1657779255803.png" alt="ha142000_0-1657779255803.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain this&amp;nbsp; what is that sales here&amp;nbsp;&amp;nbsp;Date(MonthStart(CalDate), 'MM-YYYY') as MonthYear,&lt;BR /&gt;1000*Rand() as Sales;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 06:15:23 GMT</pubDate>
    <dc:creator>ha142000</dc:creator>
    <dc:date>2022-07-14T06:15:23Z</dc:date>
    <item>
      <title>doubt in query</title>
      <link>https://community.qlik.com/t5/QlikView/doubt-in-query/m-p/1955567#M1219898</link>
      <description>&lt;P&gt;LET vDMNoOfYear =20;&lt;BR /&gt;Let vMaxDate = Floor(YearEnd(Today()-1));&amp;nbsp;&lt;BR /&gt;LET vMinDate = Floor(YearStart(AddYears(Today(), -($(vDMNoOfYear)))));&lt;/P&gt;
&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Year(CalDate) as Year,&lt;BR /&gt;WeekDay(CalDate) as WeekDay,&lt;BR /&gt;'Q' &amp;amp; Ceil(Month(CalDate)/3) as Quarter,&lt;BR /&gt;QuarterName(CalDate) as QuarterName,&lt;BR /&gt;Month(CalDate) as Month,&lt;BR /&gt;If(Month(CalDate) = Month(QuarterEnd(CalDate)), 1, 0) as MaxMonthFlag,&lt;BR /&gt;Date(MonthStart(CalDate), 'MM-YYYY') as MonthYear,&lt;BR /&gt;1000*Rand() as Sales;&lt;BR /&gt;LOAD&lt;BR /&gt;Date($(vMinDate) + IterNo()-1) as CalDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While $(vMinDate) + IterNo()-1 &amp;lt;= $(vMaxDate);&lt;/P&gt;
&lt;P&gt;LOAD QuarterName, Max(MonthYear) as MaxMonthYearPerQuarter Resident MasterCalendar Group by QuarterName;&lt;/P&gt;
&lt;P&gt;For i=5 to 20 step 5&lt;BR /&gt;Load Distinct Year, 'Last '&amp;amp; $(i) &amp;amp; ' Years' as LastNYearFlag Resident MasterCalendar&lt;BR /&gt;Where Year &amp;gt; Year(Today())-$(i);&lt;BR /&gt;next&lt;BR /&gt;&lt;BR /&gt;o/p:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ha142000_0-1657779255803.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/84118i90B9C2FE91ABEF7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ha142000_0-1657779255803.png" alt="ha142000_0-1657779255803.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain this&amp;nbsp; what is that sales here&amp;nbsp;&amp;nbsp;Date(MonthStart(CalDate), 'MM-YYYY') as MonthYear,&lt;BR /&gt;1000*Rand() as Sales;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 06:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/doubt-in-query/m-p/1955567#M1219898</guid>
      <dc:creator>ha142000</dc:creator>
      <dc:date>2022-07-14T06:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: doubt in query</title>
      <link>https://community.qlik.com/t5/QlikView/doubt-in-query/m-p/1955802#M1219907</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;As informed in the another post, its sample data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;1000*Rand() as Sales &amp;lt;-- produce random sales values multiple by 1000 * (range between 0 to 1).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Ref:&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/MathConstantsAndParamFreeFunctions/mathematical-functions.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/MathConstantsAndParamFreeFunctions/mathematical-functions.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 10:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/doubt-in-query/m-p/1955802#M1219907</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2022-07-14T10:36:14Z</dc:date>
    </item>
  </channel>
</rss>

