<?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: Formula Problem in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557193#M110901</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/129435"&gt;@GregRyder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mmm... I tested the formula that I provided in my end and it works fine. Did you aggregate the data by month in the backend?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you, please, provide me with a sample of your raw data to test it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2026 13:00:35 GMT</pubDate>
    <dc:creator>Daniel_Castella</dc:creator>
    <dc:date>2026-10-05T13:00:35Z</dc:date>
    <item>
      <title>Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557186#M110896</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am trying to calculate the month to date sales for last month. I am using an auto calendar.&lt;/P&gt;&lt;P&gt;here is my Formula&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;[TXDATE.autoCalendar.MonthsAgo]={1}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"&amp;lt;=$(=Num(Month(Today()))) "} &amp;gt;} AMOUNT)&lt;BR /&gt;-&lt;BR /&gt;Sum({&amp;lt;[TXDATE.autoCalendar.MonthsAgo]={1}, TCODE={'CN'}, [TXDATE.autoCalendar.Month] ={"&amp;lt;=$(=Num(Month(Today()))) "} &amp;gt;} AMOUNT)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 09:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557186#M110896</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-05T09:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557189#M110898</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This formula is returning the total amount for October (13months Back) and not just for the first 5 days of the month&lt;/P&gt;&lt;P&gt;&amp;nbsp;Sum({&amp;lt;[TXDATE.autoCalendar.MonthsAgo]={13}, TCODE={'IN'}, [TXDATE.autoCalendar.Month] ={"&amp;lt;=$(=Num(Month(Today()))) "} &amp;gt;} AMOUNT)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am trying to compare this year October vs last year October&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 12:01:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557189#M110898</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-05T12:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557190#M110899</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/129435"&gt;@GregRyder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is because you are never filtering by day in the set analysis. It should be something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Sum({&amp;lt;[TXDATE.autoCalendar.MonthsAgo]={13}, TCODE={'IN'}, [TXDATE.autoCalendar.Day] ={"&amp;lt;=$(=Day(Today())) "} &amp;gt;} AMOUNT)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this way you are telling to filter for the 13th prior month, code IN, and less or equal to the current day number. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suppose that the formula set in the first comment works because you don't have future data. Hence, since you only have data until day 5th, it only displays until that day.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if this works for you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kind Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 12:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557190#M110899</guid>
      <dc:creator>Daniel_Castella</dc:creator>
      <dc:date>2026-10-05T12:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557192#M110900</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Thanks for the reply, but it still returning the full amount for October 2025 and not just for the 1st 5 days of that month&lt;/P&gt;&lt;P&gt;Thanks Greg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 12:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557192#M110900</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-05T12:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557193#M110901</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/129435"&gt;@GregRyder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;mmm... I tested the formula that I provided in my end and it works fine. Did you aggregate the data by month in the backend?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you, please, provide me with a sample of your raw data to test it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 13:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557193#M110901</guid>
      <dc:creator>Daniel_Castella</dc:creator>
      <dc:date>2026-10-05T13:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557194#M110902</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;I don't aggregate the data by month at all, I have attached two files&lt;/P&gt;&lt;P&gt;Stock.csv&lt;/P&gt;&lt;P&gt;Stochist.csv&lt;/P&gt;&lt;P&gt;TCODE is for transaction code and IN is for Invoice&lt;/P&gt;&lt;P&gt;TXDATE is the date field in my data.&lt;/P&gt;&lt;P&gt;Thnaks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 13:11:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557194#M110902</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-05T13:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557199#M110903</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/129435"&gt;@GregRyder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you have an issue with your autocalendar. I have tested with the standard one and I simplified the formula, and I got the correct results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My autocalendar:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MinMax:
Load min(TXDATE) as MinDate, max(TXDATE) as MaxDate
resident StocHist;

LET vMinDate = Num(Peek('MinDate', 0, 'MinMax'));
LET vMaxDate = Num(Peek('MaxDate', 0, 'MinMax'));

TempCal:
LOAD
Date($(vMinDate) + RowNo() - 1) as TempDate
AutoGenerate
$(vMaxDate) - $(vMinDate) + 1;

MasterCalendar: 
Load
Year(TempDate) as Year,
Month(TempDate) as Month,
Day(TempDate) as Day,
Week(TempDate,6) as Week, 
WeekDay(TempDate) as DayWeekName,
TempDate as TXDATE,
Num(TempDate) as DateNumber,
Num(Month(TempDate)) as MonthNumber, 
Year(TempDate)&amp;amp;' - '&amp;amp;if(Num(Month(TempDate))&amp;lt;10,'0'&amp;amp;Num(Month(TempDate)), Num(Month(TempDate))) as Year_Month
Resident TempCal
Order By TempDate;

Drop Table TempCal, MinMax;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the formula used:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum({1&amp;lt;Year={"$(=Year(addyears(Today(),-1)))"}, Month={"$(=Month(Today()))"}, Day={"&amp;lt;=$(=day(Today()))"}, TCODE={'IN'} &amp;gt;} AMOUNT)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result, comparing the formula with the raw data for those days:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daniel_Castella_1-1791210688325.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/190448i754040C8F7B8ED01/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daniel_Castella_1-1791210688325.png" alt="Daniel_Castella_1-1791210688325.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you, please, share you autocalendar code to compare it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2026 14:33:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557199#M110903</guid>
      <dc:creator>Daniel_Castella</dc:creator>
      <dc:date>2026-10-05T14:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557222#M110906</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;My Autocalender is&lt;/P&gt;&lt;P&gt;[autoCalendar]:&lt;BR /&gt;DECLARE FIELD DEFINITION Tagged ('$date')&lt;BR /&gt;FIELDS&lt;BR /&gt;Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),&lt;BR /&gt;Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),&lt;BR /&gt;Dual(Year($1)&amp;amp;'-Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),&lt;BR /&gt;Dual('Q'&amp;amp;Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),&lt;BR /&gt;Month($1) AS [Month] Tagged ('$month', '$cyclic'),&lt;BR /&gt;Dual(Year($1)&amp;amp;'-'&amp;amp;Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),&lt;BR /&gt;Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),&lt;BR /&gt;Dual('W'&amp;amp;Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),&lt;BR /&gt;Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),&lt;BR /&gt;Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified'),&lt;BR /&gt;If (DayNumberOfYear($1) &amp;lt;= DayNumberOfYear(Today()), 1, 0) AS [InYTD] ,&lt;BR /&gt;Year(Today())-Year($1) AS [YearsAgo] ,&lt;BR /&gt;If (DayNumberOfQuarter($1) &amp;lt;= DayNumberOfQuarter(Today()),1,0) AS [InQTD] ,&lt;BR /&gt;4*Year(Today())+Ceil(Month(Today())/3)-4*Year($1)-Ceil(Month($1)/3) AS [QuartersAgo] ,&lt;BR /&gt;Ceil(Month(Today())/3)-Ceil(Month($1)/3) AS [QuarterRelNo] ,&lt;BR /&gt;If(Day($1)&amp;lt;=Day(Today()),1,0) AS [InMTD] ,&lt;BR /&gt;12*Year(Today())+Month(Today())-12*Year($1)-Month($1) AS [MonthsAgo] ,&lt;BR /&gt;Month(Today())-Month($1) AS [MonthRelNo] ,&lt;BR /&gt;If(WeekDay($1)&amp;lt;=WeekDay(Today()),1,0) AS [InWTD] ,&lt;BR /&gt;(WeekStart(Today())-WeekStart($1))/7 AS [WeeksAgo] ,&lt;BR /&gt;Week(Today())-Week($1) AS [WeekRelNo] ;&lt;BR /&gt;&lt;BR /&gt;DERIVE FIELDS FROM FIELDS [TXDATE] USING [autoCalendar] ;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 04:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557222#M110906</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-06T04:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557230#M110907</link>
      <description>&lt;P&gt;hi Danial,&lt;/P&gt;&lt;P&gt;After a full reload of my app the formula seems to be working fine now, Thanks for the assistance&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 06:05:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557230#M110907</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-06T06:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557234#M110908</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/129435"&gt;@GregRyder&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried with your autocalendar, but your formula is still giving me the same issue since, as I commented, you are not filtering by Day. I'm not sure why a full reload worked for you, but it shouldn't and the numbers could be misaligned again in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I could find why my initial comment was not working. It was because your autocalendar is not generating the field Day. You need to add it in the script as:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Day($1) AS [Day] Tagged ('$day', '$cyclic'),&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, using the first formula I provided, it works (changing the months ago to 12, not 13):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum({1&amp;lt;[TXDATE.autoCalendar.MonthsAgo]={12}, TCODE={'IN'}, [TXDATE.autoCalendar.Day] ={"&amp;lt;=$(=Day(Today())) "} &amp;gt;} AMOUNT)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Daniel_Castella_1-1791269263480.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/190453i1557F7CF38D83F88/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Daniel_Castella_1-1791269263480.png" alt="Daniel_Castella_1-1791269263480.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you can see in the picture, both of my formulas (1st and 3rd) display the same result and are aligned with the manual selection result (2nd).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 06:48:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557234#M110908</guid>
      <dc:creator>Daniel_Castella</dc:creator>
      <dc:date>2026-10-06T06:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557242#M110910</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;You were correct and the formulae now works as expected, I just one small question now.&lt;/P&gt;&lt;P&gt;The data I have is always 1 day old so as of today the 06/10/206 I only have the data until 05/10/2026 so I want to compare last year October for the same period and not include the data from 06/10/2025.&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 07:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557242#M110910</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-06T07:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Formula Problem</title>
      <link>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557243#M110911</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;I work it out.&lt;/P&gt;&lt;P&gt;Thanks for all the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 08:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Formula-Problem/m-p/2557243#M110911</guid>
      <dc:creator>GregRyder</dc:creator>
      <dc:date>2026-10-06T08:05:11Z</dc:date>
    </item>
  </channel>
</rss>

