<?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 Set Analysis (using from and to dates) with AGGR function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-from-and-to-dates-with-AGGR-function/m-p/1061385#M464488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am having trouble with this scenario. I have working code that I am using to get Working Days in the month weighted per branch (by sales $) as the branches are in different states with different public/bank holidays. I then tried to adjust that code on a different chart that has set analysis that lets the user compare two date ranges by selecting Start and End dates per period (called Primary and Secondary). However, I am not sure how to convert the Financial Year, Financial Month part into the Start and End Dates correctly. &lt;/P&gt;&lt;P&gt;Please refer to code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&lt;/P&gt;&lt;P&gt;{&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; AGGR(&lt;/P&gt;&lt;P&gt;&amp;nbsp; (SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId =1, IF(vIncGST = 0, RawPreGSTRevenue + IF(vIncBookmark = 1,PreGSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTCredit,0) + IF(vIncFuel = 1,PreGSTSurcharge,0) + + IF(vIncWarranty = 1,PreGSTWarranty,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,RawTotalRevenue + IF(vIncBookmark = 1,TotalBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalCredit,0) + IF(vIncFuel = 1,TotalSurcharge,0) + IF(vIncWarranty = 1,TotalWarranty,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 3,&amp;nbsp; IF(vIncGST = 0, PreGSTBookmarked + IF(vIncFuel = 1,PreGSTSurchargeBookmarked,0) + + IF(vIncWarranty = 1,PreGSTWarrantyBookmarked,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalBookmarked + IF(vIncFuel = 1,TotalSurchargeBookmarked,0) + IF(vIncWarranty = 1,TotalWarrantyBookmarked,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 4, IF(vIncGST = 0, PreGSTCredit + IF(vIncFuel = 1,PreGSTSurchargeCreditExTCredit,0) + + IF(vIncWarranty = 1,PreGSTWarrantyCreditExTCredit,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalCredit + IF(vIncFuel = 1,TotalSurchargeCreditExTCredit,0) + IF(vIncWarranty = 1,TotalWarrantyCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 5, IF(vIncGST = 0, PreGSTSurcharge + IF(vIncBookmark = 1,PreGSTSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTSurchargeCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,TotalSurcharge + IF(vIncBookmark = 1,TotalSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalSurchargeCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 6,RawGSTRevenue + IF(vIncBookmark = 1,GSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,GSTCredit,0) + IF(vIncFuel = 1,GSTSurcharge,0) + + IF(vIncWarranty = 1,GSTWarranty,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 7,IF(vIncGST = 0, PreGSTWarranty + IF(vIncBookmark = 1,PreGSTWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTWarrantyCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalWarranty + IF(vIncBookmark = 1,TotalWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalWarrantyCreditExTCredit,0)),0))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&amp;nbsp; / SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}TOTAL&amp;lt;{&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"},ACWWeightBreakName&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId =1, IF(vIncGST = 0, RawPreGSTRevenue + IF(vIncBookmark = 1,PreGSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTCredit,0) + IF(vIncFuel = 1,PreGSTSurcharge,0) + + IF(vIncWarranty = 1,PreGSTWarranty,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,RawTotalRevenue + IF(vIncBookmark = 1,TotalBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalCredit,0) + IF(vIncFuel = 1,TotalSurcharge,0) + IF(vIncWarranty = 1,TotalWarranty,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 3,&amp;nbsp; IF(vIncGST = 0, PreGSTBookmarked + IF(vIncFuel = 1,PreGSTSurchargeBookmarked,0) + + IF(vIncWarranty = 1,PreGSTWarrantyBookmarked,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalBookmarked + IF(vIncFuel = 1,TotalSurchargeBookmarked,0) + IF(vIncWarranty = 1,TotalWarrantyBookmarked,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 4, IF(vIncGST = 0, PreGSTCredit + IF(vIncFuel = 1,PreGSTSurchargeCreditExTCredit,0) + + IF(vIncWarranty = 1,PreGSTWarrantyCreditExTCredit,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalCredit + IF(vIncFuel = 1,TotalSurchargeCreditExTCredit,0) + IF(vIncWarranty = 1,TotalWarrantyCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 5, IF(vIncGST = 0, PreGSTSurcharge + IF(vIncBookmark = 1,PreGSTSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTSurchargeCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,TotalSurcharge + IF(vIncBookmark = 1,TotalSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalSurchargeCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 6,RawGSTRevenue + IF(vIncBookmark = 1,GSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,GSTCredit,0) + IF(vIncFuel = 1,GSTSurcharge,0) + + IF(vIncWarranty = 1,GSTWarranty,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 7,IF(vIncGST = 0, PreGSTWarranty + IF(vIncBookmark = 1,PreGSTWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTWarrantyCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalWarranty + IF(vIncBookmark = 1,TotalWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalWarrantyCreditExTCredit,0)),0))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&amp;nbsp; * MAX({&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}TotalDaysInMonth)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,ACWWeightBreakName,InvoiceBranchName&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hoping someone can give me some guidance....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 03:02:45 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-20T03:02:45Z</dc:date>
    <item>
      <title>Set Analysis (using from and to dates) with AGGR function</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-using-from-and-to-dates-with-AGGR-function/m-p/1061385#M464488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I am having trouble with this scenario. I have working code that I am using to get Working Days in the month weighted per branch (by sales $) as the branches are in different states with different public/bank holidays. I then tried to adjust that code on a different chart that has set analysis that lets the user compare two date ranges by selecting Start and End dates per period (called Primary and Secondary). However, I am not sure how to convert the Financial Year, Financial Month part into the Start and End Dates correctly. &lt;/P&gt;&lt;P&gt;Please refer to code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&lt;/P&gt;&lt;P&gt;{&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; AGGR(&lt;/P&gt;&lt;P&gt;&amp;nbsp; (SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId =1, IF(vIncGST = 0, RawPreGSTRevenue + IF(vIncBookmark = 1,PreGSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTCredit,0) + IF(vIncFuel = 1,PreGSTSurcharge,0) + + IF(vIncWarranty = 1,PreGSTWarranty,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,RawTotalRevenue + IF(vIncBookmark = 1,TotalBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalCredit,0) + IF(vIncFuel = 1,TotalSurcharge,0) + IF(vIncWarranty = 1,TotalWarranty,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 3,&amp;nbsp; IF(vIncGST = 0, PreGSTBookmarked + IF(vIncFuel = 1,PreGSTSurchargeBookmarked,0) + + IF(vIncWarranty = 1,PreGSTWarrantyBookmarked,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalBookmarked + IF(vIncFuel = 1,TotalSurchargeBookmarked,0) + IF(vIncWarranty = 1,TotalWarrantyBookmarked,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 4, IF(vIncGST = 0, PreGSTCredit + IF(vIncFuel = 1,PreGSTSurchargeCreditExTCredit,0) + + IF(vIncWarranty = 1,PreGSTWarrantyCreditExTCredit,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalCredit + IF(vIncFuel = 1,TotalSurchargeCreditExTCredit,0) + IF(vIncWarranty = 1,TotalWarrantyCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 5, IF(vIncGST = 0, PreGSTSurcharge + IF(vIncBookmark = 1,PreGSTSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTSurchargeCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,TotalSurcharge + IF(vIncBookmark = 1,TotalSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalSurchargeCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 6,RawGSTRevenue + IF(vIncBookmark = 1,GSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,GSTCredit,0) + IF(vIncFuel = 1,GSTSurcharge,0) + + IF(vIncWarranty = 1,GSTWarranty,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 7,IF(vIncGST = 0, PreGSTWarranty + IF(vIncBookmark = 1,PreGSTWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTWarrantyCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalWarranty + IF(vIncBookmark = 1,TotalWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalWarrantyCreditExTCredit,0)),0))))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&amp;nbsp; / SUM(&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}TOTAL&amp;lt;{&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"},ACWWeightBreakName&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId =1, IF(vIncGST = 0, RawPreGSTRevenue + IF(vIncBookmark = 1,PreGSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTCredit,0) + IF(vIncFuel = 1,PreGSTSurcharge,0) + + IF(vIncWarranty = 1,PreGSTWarranty,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,RawTotalRevenue + IF(vIncBookmark = 1,TotalBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalCredit,0) + IF(vIncFuel = 1,TotalSurcharge,0) + IF(vIncWarranty = 1,TotalWarranty,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 3,&amp;nbsp; IF(vIncGST = 0, PreGSTBookmarked + IF(vIncFuel = 1,PreGSTSurchargeBookmarked,0) + + IF(vIncWarranty = 1,PreGSTWarrantyBookmarked,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalBookmarked + IF(vIncFuel = 1,TotalSurchargeBookmarked,0) + IF(vIncWarranty = 1,TotalWarrantyBookmarked,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 4, IF(vIncGST = 0, PreGSTCredit + IF(vIncFuel = 1,PreGSTSurchargeCreditExTCredit,0) + + IF(vIncWarranty = 1,PreGSTWarrantyCreditExTCredit,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalCredit + IF(vIncFuel = 1,TotalSurchargeCreditExTCredit,0) + IF(vIncWarranty = 1,TotalWarrantyCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 5, IF(vIncGST = 0, PreGSTSurcharge + IF(vIncBookmark = 1,PreGSTSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTSurchargeCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,TotalSurcharge + IF(vIncBookmark = 1,TotalSurchargeBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalSurchargeCreditExTCredit,0)),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 6,RawGSTRevenue + IF(vIncBookmark = 1,GSTBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,GSTCredit,0) + IF(vIncFuel = 1,GSTSurcharge,0) + + IF(vIncWarranty = 1,GSTWarranty,0),&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(vRevenueTypeId = 7,IF(vIncGST = 0, PreGSTWarranty + IF(vIncBookmark = 1,PreGSTWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,PreGSTWarrantyCreditExTCredit,0) &lt;/P&gt;&lt;P&gt;&amp;nbsp; ,TotalWarranty + IF(vIncBookmark = 1,TotalWarrantyBookmarked,0)&amp;nbsp; + IF(vIncCredit = 1,TotalWarrantyCreditExTCredit,0)),0))))))&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) &lt;/P&gt;&lt;P&gt;&amp;nbsp; * MAX({&amp;lt;SalesPostDate={"&amp;gt;=$(vSVStartDateP1Format)&amp;lt;=$(vSVEndDateP1Format)"}, MonthYear=, FinancialYear= , FinancialMonth= ,CalendarYear= ,Day= ,Quarter= &amp;gt;}TotalDaysInMonth)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,ACWWeightBreakName,InvoiceBranchName&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hoping someone can give me some guidance....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 03:02:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-using-from-and-to-dates-with-AGGR-function/m-p/1061385#M464488</guid>
      <dc:creator />
      <dc:date>2016-04-20T03:02:45Z</dc:date>
    </item>
  </channel>
</rss>

