<?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: Custom Functions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544567#M109697</link>
    <description>&lt;P&gt;It looks that your comma-separated dates-list is causing your issues because the comma will be treated as parameter-delimiter from the variable.&lt;/P&gt;&lt;P&gt;There exists no way in Qlik to mask them - therefore you need either a different function/syntax which worked without such comma-list or a replace-approach for the critical char (forward + backward) or transferring the information with n separate parameters.&lt;/P&gt;&lt;P&gt;At the moment I have no ideas how to switch the function/syntax (applying similar logic in the UI by set statements there are various ways to define them) and applying n parameters seems not really sensible. But a replace of the comma with any other char like a pipe and then replacing it within another $-sign expansion in the function may be a practically workaround.&lt;/P&gt;&lt;P&gt;Beside this you may consider to change the logic completely, for example by defining your working-days within the calendar. It's there a simple two step approach of adding a 0/1 flag if a day is a working-day or not (querying the weekends per weekday() and mapping the holidays/special-days from an external table) and the next step is accumulating this flag within another field. The networkdays are then just the difference from the date 1/2 mapping against the calendar(extract). Nearly all kind of date/offset-calculation could be with such logic replaced or at least significantly simplified.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Mar 2026 12:38:35 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2026-03-11T12:38:35Z</dc:date>
    <item>
      <title>Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544463#M109687</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I created a custom function to tidy up my script. The below code repeats itself 6 times, I can make it work with parameterized variables like below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Set vFark=
Interval(
	rangesum(
		NetWorkDays(Peek($1)+1, $1-1, $(vResmiTatiller), $($2)) * ($(vMesaiSaati)/24)	// 9h per workday, for all days inbetween the period, excluding bounderies 
		,if(NetWorkDays($1, $1, $(vResmiTatiller), $($2)), frac($1),0)  														// working hours last day
		,if(NetWorkDays(Peek($1),Peek($1), $(vResmiTatiller), $($2)),($(vMesaiSaati)/24)-frac(Peek($1)),0) 				// working hours first day
		,if(NetWorkDays(Peek($1),Peek($1), $(vResmiTatiller), $($2)) and floor(Peek($1))=floor($1),-1*($(vMesaiSaati)/24)) 	// correct for first equals last day
	)
)
;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and used that vFark in the load as below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$(vFark(FIRSTRESPONSE, vVacYK))&lt;/LI-CODE&gt;&lt;P&gt;FIRSTRESPONSE is a date field, vVacYK is a variable that has these values: '14.01.2026','15.01.2026' and vResmiTatiller has all holiday dates in the same format with vVacYK:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="variables.png" style="width: 888px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187217i2BA5D84C8FAFDFFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="variables.png" alt="variables.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The problem is, if I dont make it a custom function it works and show 0 as intended, but in custom function it returns values higher than 0 for the vacation days.&lt;BR /&gt;Can you please help me?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2026 14:29:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544463#M109687</guid>
      <dc:creator>BIAKS</dc:creator>
      <dc:date>2026-03-10T14:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544567#M109697</link>
      <description>&lt;P&gt;It looks that your comma-separated dates-list is causing your issues because the comma will be treated as parameter-delimiter from the variable.&lt;/P&gt;&lt;P&gt;There exists no way in Qlik to mask them - therefore you need either a different function/syntax which worked without such comma-list or a replace-approach for the critical char (forward + backward) or transferring the information with n separate parameters.&lt;/P&gt;&lt;P&gt;At the moment I have no ideas how to switch the function/syntax (applying similar logic in the UI by set statements there are various ways to define them) and applying n parameters seems not really sensible. But a replace of the comma with any other char like a pipe and then replacing it within another $-sign expansion in the function may be a practically workaround.&lt;/P&gt;&lt;P&gt;Beside this you may consider to change the logic completely, for example by defining your working-days within the calendar. It's there a simple two step approach of adding a 0/1 flag if a day is a working-day or not (querying the weekends per weekday() and mapping the holidays/special-days from an external table) and the next step is accumulating this flag within another field. The networkdays are then just the difference from the date 1/2 mapping against the calendar(extract). Nearly all kind of date/offset-calculation could be with such logic replaced or at least significantly simplified.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2026 12:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544567#M109697</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-11T12:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544571#M109698</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I didn't quite understand what you meant but the below formula works with my date variables:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Interval(
					rangesum(
						NetWorkDays(Peek(FIRSTRESPONSE)+1, FIRSTRESPONSE-1, $(vResmiTatiller), $(vVacYK)) * ($(vMesaiSaati)/24)															
						,if(NetWorkDays(FIRSTRESPONSE, FIRSTRESPONSE, $(vResmiTatiller), $(vVacYK)), frac(FIRSTRESPONSE),0)  															
						,if(NetWorkDays(Peek(FIRSTRESPONSE),Peek(FIRSTRESPONSE), $(vResmiTatiller), $(vVacYK)),(1*($(vMesaiSaati)/24))-frac(Peek(FIRSTRESPONSE)),0) 						
						,if(NetWorkDays(Peek(FIRSTRESPONSE),Peek(FIRSTRESPONSE), $(vResmiTatiller), $(vVacYK)) and floor(Peek(FIRSTRESPONSE))=floor(FIRSTRESPONSE),-1*($(vMesaiSaati)/24))
					)
				), &lt;/LI-CODE&gt;&lt;P&gt;What is the difference between the code above and the one in vFark variable? Also it is calculating the networkdays but giving the wrong results.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2026 12:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544571#M109698</guid>
      <dc:creator>BIAKS</dc:creator>
      <dc:date>2026-03-11T12:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544590#M109701</link>
      <description>&lt;P&gt;This statement from the second if-loop:&lt;/P&gt;&lt;P&gt;(1*($(vMesaiSaati)/24))-frac(Peek(FIRSTRESPONSE)),0)&lt;/P&gt;&lt;P&gt;is different to:&lt;/P&gt;&lt;P&gt;($(vMesaiSaati)/24)-frac(Peek($1)),0)&lt;/P&gt;&lt;P&gt;Beside this - don't add comments within the variables because it has potential to get in interaction with the wanted script and could make a troubleshooting quite expensive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2026 14:27:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544590#M109701</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-11T14:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544633#M109706</link>
      <description>&lt;P&gt;That is not a difference in algorithm which I meant. They are almost identical but one is working and the other is not. I want to know the reason behind this so I can make it work or learn that there is no way to do it this way.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 06:03:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544633#M109706</guid>
      <dc:creator>BIAKS</dc:creator>
      <dc:date>2026-03-12T06:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544637#M109707</link>
      <description>&lt;P&gt;My approach to build multi-step logic respectively to troubleshoot unexpected results is to distribute it into n separate and parallel steps to check if they are working on this level respectively to adjust them. In the worst-case to the most granular level but usually starting with the half and then the half from the half ... Mostly it's not a detour else a fast method because looking for mistakes in more complex logic could become rather painfully ...&lt;/P&gt;&lt;P&gt;This is my general way with native script - the transfer of the sub-parts into n variables and then combining and/or nesting them comes afterwards. If then anything is failing the cause is the creation and/or calling the variables. And here are starting special difficulties because depending on the kind of content of the variables - numbers, strings, with/without included commas/brackets/quotes - the creation and calling might be different. Therefore the usage of combined and/or nested variables should be considered carefully because the complexity could become easily higher as the aim of variables to simplify an approach.&lt;/P&gt;&lt;P&gt;A special challenge is the use of comments within the variables - because each one checked alone may working like expected and the combined/nested it doesn't work anymore. The reason is that the entire variable including the comments are at first combined/nested and then starts their evaluation and here the comments could touch the other variables, like:&lt;/P&gt;&lt;P&gt;set v1 = 1 // it's aimed as ...;&lt;BR /&gt;set v2 = 2;&lt;BR /&gt;let v3 = $(1) + $(2);&lt;/P&gt;&lt;P&gt;what happens then is:&lt;/P&gt;&lt;P&gt;let v3 =&amp;nbsp; 1 // it's aimed as ... + 2;&lt;/P&gt;&lt;P&gt;Therefore my previous suggestion to add no comments within the variables to avoid any potentially struggle.&lt;/P&gt;&lt;P&gt;Beside all this be aware that you are using peek() and field-references within the variables which are depending on various factors, for example needs peek() a defined sorting within a resident-load and field-references might be easily failing by (the hot loved) usage of qualify-statements. This means unexpected results might be also caused from a different underlying data-set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 06:54:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544637#M109707</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-12T06:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544642#M109708</link>
      <description>&lt;P&gt;Ok, I tried to make a simple scenario with same use case:&lt;/P&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Calendar:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;NoConcatenate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Date(IterNo()+StartDate-1) as CalendarDate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;While IterNo()+StartDate-1 &amp;lt;= EndDate;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load * Inline [&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;StartDate, EndDate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;01.01.2026, 30.01.2026&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Vacations:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;NoConcatenate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Date(IterNo()+StartDate-1) as VacationDates&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;While IterNo()+StartDate-1 &amp;lt;= EndDate;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load * Inline [&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;StartDate, EndDate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;03.01.2026, 10.01.2026&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;VacationConcat:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;NoConcatenate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Concat(chr(39) &amp;amp; VacationDates &amp;amp; chr(39),',' ) as Vacations&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Resident Vacations;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Drop Table Vacations;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Let vVacations = FieldValue('Vacations',1);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Set vNetWork = NetWorkDays($1, $1, $(vVacations));&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;NetDays:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;NoConcatenate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;CalendarDate,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;// NetWorkDays(CalendarDate, CalendarDate, $(vVacations)) as IsWorkingDay&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;$(vNetWork(CalendarDate)) as IsWorkingDay&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Resident Calendar;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Drop Table Calendar;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;If I change&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;$(vNetWork(CalendarDate)) as IsWorkingDay&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;FONT size="4"&gt;to&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;$(vNetWork(CalendarDate, vVacations)) as IsWorkingDay&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;FONT size="4"&gt;and&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Set vNetWork = NetWorkDays($1, $1, $(vVacations));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;FONT size="4"&gt;to&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Set vNetWork = NetWorkDays($1, $1, $($2));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;FONT size="4"&gt;&lt;FONT size="2"&gt;&lt;FONT size="4"&gt;it doesn't work. But I think it should work.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 07:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544642#M109708</guid>
      <dc:creator>BIAKS</dc:creator>
      <dc:date>2026-03-12T07:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544680#M109715</link>
      <description>&lt;P&gt;In general could such approach be working. If it doesn't it means that there are any issues with the syntax or the data. In this example are both dates equally $1 and it might be that the call of the date may look like '$1' and that $($2) expands the date-list and causing the comma-problem ...&lt;/P&gt;&lt;P&gt;Like hinted the combination/nesting of variables isn't trivial and should be no standard-approach - else only be used in a few special scenarios which are be worth to invest extra efforts. In my early days it did a lot of such stuff but the development-times are too long and even much more important the maintaining becomes easily a nightmare ... especially if anything goes wrong and it needs a fast fix.&lt;/P&gt;&lt;P&gt;Like mentioned above I wouldn't use networkdays() because there are better and more powerful methods. It goes in this direction:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Vacations:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;mapping&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Date(IterNo()+StartDate-1) as Lookup, 1 as Return&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;While IterNo()+StartDate-1 &amp;lt;= EndDate;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load * Inline [&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;StartDate, EndDate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;03.01.2026, 10.01.2026&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Calendar:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;load *, rangesum(peek('FlagCum'), Flag) as FlagCum;&lt;BR /&gt;load *, if(weekday(CalendarDate) &amp;gt;= 5 or applymap('Vacations', CalendarDate, 0), 0, 1) as Flag;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Date(IterNo()+StartDate-1) as CalendarDate&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;While IterNo()+StartDate-1 &amp;lt;= EndDate;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Load * Inline [&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;StartDate, EndDate&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;01.01.2026, 30.01.2026&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If any loads require a networkday-calculation the date + the accumulated value are extracted within another mapping and then:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;applymap('CalendarWorkDays', Date1, null()) -&amp;nbsp;applymap('CalendarWorkDays', Date2, null())&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;returns the workdays.&lt;/P&gt;&lt;P&gt;Within the UI it could be used similar with a:&lt;/P&gt;&lt;P&gt;max(Date) - min(Date)&lt;/P&gt;&lt;P&gt;or quite often just with:&lt;/P&gt;&lt;P&gt;sum(Flag)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 14:00:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544680#M109715</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-12T14:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Functions</title>
      <link>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544684#M109716</link>
      <description>&lt;P&gt;Thank you for your explanation, but I currently don't have any problem with networkdays.&lt;/P&gt;&lt;P&gt;I used the same function a lot and I wanted to reduce it so I tried custom functions. Like you said, maybe Qlik doesn't handle variables like dimensions so I can't apply my logic. I wish there was a better debug mode for this so I could check the evaluations behind the script. Standart debug doesn't go deep into variable evals or any load step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time and effort, again. I will continue with my repeated function &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 14:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Custom-Functions/m-p/2544684#M109716</guid>
      <dc:creator>BIAKS</dc:creator>
      <dc:date>2026-03-12T14:21:34Z</dc:date>
    </item>
  </channel>
</rss>

