<?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: How to find date where cumulative sum reaches variable threshold using chart expression only? in Qlik Answers</title>
    <link>https://community.qlik.com/t5/Qlik-Answers/How-to-find-date-where-cumulative-sum-reaches-variable-threshold/m-p/2534390#M487</link>
    <description>&lt;P&gt;Hi, I don't know what's the expected result, the example only has one CAMPO and INVERNADERO, if it helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(
Sum(
    Aggr(
        If(FECHA_CLIMA &amp;gt;= FECHA_ALTA AND FECHA_CLIMA &amp;lt;= FECHACORTE, VAL),
        FECHA_CLIMA, FECHA_ALTA, FECHACORTE
    )
)&amp;gt;60 and
Sum(
    Aggr(
        If(Above(FECHA_CLIMA) &amp;gt;= Above(FECHA_ALTA) AND Above(FECHA_CLIMA) &amp;lt;= Above(FECHACORTE), Above(VAL)),
        FECHA_CLIMA, FECHA_ALTA, FECHACORTE
    )
)&amp;lt;60
,FECHACORTE)&lt;/LI-CODE&gt;&lt;P&gt;Will write the date when the accumulate changes.&lt;/P&gt;&lt;P&gt;If there is a fixed formula since FECHA_ALTA, it will be better the have precalculated values using the script, that would make the measures a lot easier to calculate.&lt;/P&gt;</description>
    <pubDate>Sat, 25 Oct 2025 11:49:04 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2025-10-25T11:49:04Z</dc:date>
    <item>
      <title>How to find date where cumulative sum reaches variable threshold using chart expression only?</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/How-to-find-date-where-cumulative-sum-reaches-variable-threshold/m-p/2533993#M480</link>
      <description>&lt;P class="whitespace-normal break-words"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;Hello community,&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;I have two tables linked by the &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;CAMPO&lt;/CODE&gt; field:&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Table 1: CONTEO&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL class="[&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc space-y-2.5 pl-7"&gt;
&lt;LI class="whitespace-normal break-words"&gt;Fields: &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;CAMPO&lt;/CODE&gt;, &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;INVERNADERO&lt;/CODE&gt;, &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;FECHA_ALTA&lt;/CODE&gt;, &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;FECHACORTE&lt;/CODE&gt;, etc.&lt;/LI&gt;
&lt;LI class="whitespace-normal break-words"&gt;Example: CAMPO="SONORA", FECHA_ALTA=08/08/2025&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Table 2: Forecast_Clima_VAL&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL class="[&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc space-y-2.5 pl-7"&gt;
&lt;LI class="whitespace-normal break-words"&gt;Fields: &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;CAMPO&lt;/CODE&gt;, &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;FECHA_CLIMA&lt;/CODE&gt;, &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;VAL&lt;/CODE&gt; (daily numeric values)&lt;/LI&gt;
&lt;LI class="whitespace-normal break-words"&gt;Example data:&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE class="bg-bg-100 min-w-full border-separate border-spacing-0 text-sm leading-[1.88888] whitespace-normal"&gt;
&lt;THEAD class="border-b-border-100/50 border-b-[0.5px] text-left"&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TH class="text-text-000 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;CAMPO&lt;/TH&gt;
&lt;TH class="text-text-000 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;FECHA_CLIMA&lt;/TH&gt;
&lt;TH class="text-text-000 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;VAL&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;SONORA&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;08/08/2025&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;1.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;SONORA&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;09/08/2025&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;1.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;SONORA&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;10/08/2025&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;2.0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;...&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;...&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="[tbody&amp;gt;&amp;amp;]:odd:bg-bg-500/10"&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;SONORA&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;05/10/2025&lt;/TD&gt;
&lt;TD class="border-t-border-100/50 [&amp;amp;:not(:first-child)]:-x-[hsla(var(--border-100) / 0.5)] border-t-[0.5px] px-2 [&amp;amp;:not(:first-child)]:border-l-[0.5px]"&gt;1.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Objective:&lt;/STRONG&gt; I need to calculate the date when the cumulative sum of VAL reaches 80, starting from &lt;CODE class="bg-text-200/5 border border-0.5 border-border-300 text-danger-000 whitespace-pre-wrap rounded-[0.4rem] px-1 py-px text-[0.9rem]"&gt;FECHA_ALTA&lt;/CODE&gt; of each record in CONTEO.&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Expected example:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL class="[&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-disc space-y-2.5 pl-7"&gt;
&lt;LI class="whitespace-normal break-words"&gt;FECHA_ALTA: 08/08/2025&lt;/LI&gt;
&lt;LI class="whitespace-normal break-words"&gt;Cumulative sum: 1.5 → 2.5 → 4.5 → ... → 78.3 → 79.8 → 81.3&lt;/LI&gt;
&lt;LI class="whitespace-normal break-words"&gt;Result: 06/10/2025 (first date where cumulative ≥ 80)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;What already works:&lt;/STRONG&gt; This expression correctly sums VAL in a range:&lt;/P&gt;
&lt;DIV class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg"&gt;
&lt;DIV class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"&gt;
&lt;DIV class="absolute right-0 h-8 px-2 items-center inline-flex z-10"&gt;
&lt;DIV class="relative"&gt;
&lt;DIV class="flex items-center justify-center transition-all opacity-100 scale-100"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="flex items-center justify-center absolute top-0 left-0 transition-all opacity-0 scale-50"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="text-text-500 font-small p-3.5 pb-0"&gt;qlik&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"&gt;&lt;CODE class="language-qlik"&gt;&lt;SPAN&gt;Sum(
&lt;/SPAN&gt;&lt;SPAN&gt;    Aggr(
&lt;/SPAN&gt;&lt;SPAN&gt;        If(FECHA_CLIMA &amp;gt;= FECHA_ALTA AND FECHA_CLIMA &amp;lt;= FECHACORTE, VAL),
&lt;/SPAN&gt;&lt;SPAN&gt;        FECHA_CLIMA, FECHA_ALTA, FECHACORTE
&lt;/SPAN&gt;&lt;SPAN&gt;    )
&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="whitespace-normal break-words"&gt;This expression returns the total from FECHA_ALTA:&lt;/P&gt;
&lt;DIV class="relative group/copy bg-bg-000/50 border-0.5 border-border-400 rounded-lg"&gt;
&lt;DIV class="sticky opacity-0 group-hover/copy:opacity-100 top-2 py-2 h-12 w-0 float-right"&gt;
&lt;DIV class="absolute right-0 h-8 px-2 items-center inline-flex z-10"&gt;
&lt;DIV class="relative"&gt;
&lt;DIV class="flex items-center justify-center transition-all opacity-100 scale-100"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="flex items-center justify-center absolute top-0 left-0 transition-all opacity-0 scale-50"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="text-text-500 font-small p-3.5 pb-0"&gt;qlik&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE class="code-block__code !my-0 !rounded-lg !text-sm !leading-relaxed"&gt;&lt;CODE class="language-qlik"&gt;&lt;SPAN&gt;=Sum({&amp;lt;FECHA_CLIMA={"&amp;gt;=$(=FECHA_ALTA)"}&amp;gt;} VAL)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Constraints:&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL class="[&amp;amp;:not(:last-child)_ul]:pb-1 [&amp;amp;:not(:last-child)_ol]:pb-1 list-decimal space-y-2.5 pl-7"&gt;
&lt;LI class="whitespace-normal break-words"&gt;I cannot modify the load script&lt;/LI&gt;
&lt;LI class="whitespace-normal break-words"&gt;I have a variable vVAL_Salida=80 (dynamic value, can change over time)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P class="whitespace-normal break-words"&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt; Is it possible to calculate this with an expression in a chart?&lt;/P&gt;
&lt;P class="whitespace-normal break-words"&gt;I appreciate any guidance.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Oct 2025 18:31:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/How-to-find-date-where-cumulative-sum-reaches-variable-threshold/m-p/2533993#M480</guid>
      <dc:creator>07734</dc:creator>
      <dc:date>2025-10-21T18:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find date where cumulative sum reaches variable threshold using chart expression only?</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/How-to-find-date-where-cumulative-sum-reaches-variable-threshold/m-p/2534390#M487</link>
      <description>&lt;P&gt;Hi, I don't know what's the expected result, the example only has one CAMPO and INVERNADERO, if it helps.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If(
Sum(
    Aggr(
        If(FECHA_CLIMA &amp;gt;= FECHA_ALTA AND FECHA_CLIMA &amp;lt;= FECHACORTE, VAL),
        FECHA_CLIMA, FECHA_ALTA, FECHACORTE
    )
)&amp;gt;60 and
Sum(
    Aggr(
        If(Above(FECHA_CLIMA) &amp;gt;= Above(FECHA_ALTA) AND Above(FECHA_CLIMA) &amp;lt;= Above(FECHACORTE), Above(VAL)),
        FECHA_CLIMA, FECHA_ALTA, FECHACORTE
    )
)&amp;lt;60
,FECHACORTE)&lt;/LI-CODE&gt;&lt;P&gt;Will write the date when the accumulate changes.&lt;/P&gt;&lt;P&gt;If there is a fixed formula since FECHA_ALTA, it will be better the have precalculated values using the script, that would make the measures a lot easier to calculate.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2025 11:49:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/How-to-find-date-where-cumulative-sum-reaches-variable-threshold/m-p/2534390#M487</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2025-10-25T11:49:04Z</dc:date>
    </item>
  </channel>
</rss>

