<?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: Calculation of YTD in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707249#M451539</link>
    <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;Total YTD Processed&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {1&amp;lt;[Processing Status]={'P'}, Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(Count(DISTINCT {1&amp;lt;[Processing Status]={'P'}, Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])
/Count(DISTINCT TOTAL{1&amp;lt; Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Severe Injury Count&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {&amp;lt;[Injury Type]={'Severe'}&amp;gt;}[Claim Number])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also. for further help refer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/YTQ-QTD-MTD-and-WTD/ta-p/1489245" target="_self"&gt;YTD MTD QTD&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jun 2020 19:59:23 GMT</pubDate>
    <dc:creator>vamsee</dc:creator>
    <dc:date>2020-06-01T19:59:23Z</dc:date>
    <item>
      <title>Calculation of YTD in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707236#M451538</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have the following dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="361"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="73"&gt;Date&lt;/TD&gt;&lt;TD width="97"&gt;Claim Number&lt;/TD&gt;&lt;TD width="115"&gt;Processing Status&lt;/TD&gt;&lt;TD width="76"&gt;Injury Type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25-05-2020&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25-05-2020&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01-06-2020&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08-06-2020&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08-06-2020&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;Minor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15-06-2020&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15-06-2020&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15-06-2020&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;Severe&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to calculate YTD numbers for:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. total processed (Count of claims with Processing status as P)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. % processed (Count of claims with Processing status as P / all claims)*100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Total number of severe injuries&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I tried many methods like AsOfTable, Using RangeSum and Above combinations etc. All these works but the problem is I need to have a date filter in my dashboard. So when i select a particular date, the data is shown only for that date but i want it to be from the start of the year.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Any idea on how to implement ? Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:34:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707236#M451538</guid>
      <dc:creator>vmurugananthan</dc:creator>
      <dc:date>2024-11-16T00:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of YTD in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707249#M451539</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;Total YTD Processed&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {1&amp;lt;[Processing Status]={'P'}, Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(Count(DISTINCT {1&amp;lt;[Processing Status]={'P'}, Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])
/Count(DISTINCT TOTAL{1&amp;lt; Date=,Date={"&amp;gt;=$(=(YearStart(Max(Date))))&amp;lt;=$(=Max(Date))"}&amp;gt;}[Claim Number])
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Severe Injury Count&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count(DISTINCT {&amp;lt;[Injury Type]={'Severe'}&amp;gt;}[Claim Number])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also. for further help refer&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/YTQ-QTD-MTD-and-WTD/ta-p/1489245" target="_self"&gt;YTD MTD QTD&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 19:59:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707249#M451539</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2020-06-01T19:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of YTD in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707250#M451540</link>
      <description>&lt;P&gt;If you want selections to affect the calculations, you can't calculate it in the script.&amp;nbsp; You'll need to write an expression on the chart to calculate the YTD values.&lt;/P&gt;&lt;P&gt;Here are some good posts to get you started:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Documents/Calculating-rolling-n-period-totals-averages-or-other/ta-p/1483033" target="_blank"&gt;https://community.qlik.com/t5/QlikView-Documents/Calculating-rolling-n-period-totals-averages-or-other/ta-p/1483033&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Development/How-to-calculate-YTD/m-p/1218324" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Development/How-to-calculate-YTD/m-p/1218324&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2020 20:00:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707250#M451540</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2020-06-01T20:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of YTD in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707699#M451553</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50135"&gt;@vamsee&lt;/a&gt;&amp;nbsp;The given expression solves the purpose. But in the denominator for %processed expression, removing TOTAL keyword&amp;nbsp; gives the required result.&lt;/P&gt;&lt;P&gt;Also what is the reason that you have added 1 in all the expressions? The expression holds good even without the 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyways thanks much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 06:43:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707699#M451553</guid>
      <dc:creator>vmurugananthan</dc:creator>
      <dc:date>2020-06-03T06:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation of YTD in script</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707876#M451559</link>
      <description>&lt;P&gt;As you mentioned in your post that selecting a date alters the chart and displays only for the date selected. "1" is an identifier.&lt;/P&gt;&lt;P&gt;$- Default identified, considers the current selections into account while calculating the chart&lt;/P&gt;&lt;P&gt;1- Does not consider any selections while calculating the chart&lt;/P&gt;&lt;P&gt;Refer&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/ChartFunctions/SetAnalysis/set-analysis-expressions.htm" target="_self"&gt;Identifiers in Qlik&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/" target="_self"&gt;set-analysis-qlikview&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As your issue is resolved, please mark the correct answer and close the thread.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 15:18:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-of-YTD-in-script/m-p/1707876#M451559</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2020-06-03T15:18:26Z</dc:date>
    </item>
  </channel>
</rss>

