<?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 call &amp;quot;Master Item&amp;quot; into a formula? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2140423#M92728</link>
    <description>&lt;P&gt;Have to dive deep to check, try square brackets&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 15:37:48 GMT</pubDate>
    <dc:creator>Aasir</dc:creator>
    <dc:date>2023-11-22T15:37:48Z</dc:date>
    <item>
      <title>How to call "Master Item" into a formula?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139619#M92626</link>
      <description>&lt;P&gt;Hello, I developed the formula below to calculate according to the period selection on the frontend.&amp;nbsp;Is there any way to call Master Item to this formula?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=if(GetFieldSelections([Period])='Daily',avg({&amp;lt;Today_T= {'$(vYesterday)'}&amp;gt;} [calculated_masteritem]),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(GetFieldSelections([Period])='Weekly',avg({&amp;lt;Today_T= {'$(vPreviousWeek)'}&amp;gt;} [calculated_masteritem]),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(GetFieldSelections([Period])='Monthly', avg({&amp;lt; Monthly = {'$(vMonthly)'}&amp;gt;} [calculated_masteritem])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The syntax seems correct but result 0 returning &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 07:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139619#M92626</guid>
      <dc:creator>Milaf</dc:creator>
      <dc:date>2023-11-21T07:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to call "Master Item" into a formula?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139631#M92627</link>
      <description>&lt;P&gt;Your formula looks correct.&lt;BR /&gt;&lt;SPAN&gt;Ensure that the Master Item &lt;/SPAN&gt;&lt;CODE&gt;[calculated_masteritem]&lt;/CODE&gt;&lt;SPAN&gt; is working as expected independently. You can test it by directly using this Master Item in a chart or table to verify that it produces the desired values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Double-check the values of your variables (&lt;/SPAN&gt;&lt;CODE&gt;vYesterday&lt;/CODE&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;CODE&gt;vPreviousWeek&lt;/CODE&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;CODE&gt;vMonthly&lt;/CODE&gt;&lt;SPAN&gt;) to make sure they are being set correctly and are valid dates.&lt;/SPAN&gt;&lt;BR /&gt;You can add temporary variables or text boxes in your Qlik Sense app to display the values of your variables and selections. This can help you debug and understand what values are being used in your calculations.&lt;/P&gt;
&lt;P&gt;Below is a modified version of your formula with additional labels for each condition, which might help you identify the issue:&lt;BR /&gt;&lt;BR /&gt;=if(GetFieldSelections([Period])='Daily',&lt;BR /&gt;avg({&amp;lt;Today_T= {'$(vYesterday)'}&amp;gt;} [calculated_masteritem]),&lt;BR /&gt;if(GetFieldSelections([Period])='Weekly',&lt;BR /&gt;avg({&amp;lt;Today_T= {'$(vPreviousWeek)'}&amp;gt;} [calculated_masteritem]),&lt;BR /&gt;if(GetFieldSelections([Period])='Monthly',&lt;BR /&gt;avg({&amp;lt; Monthly = {'$(vMonthly)'}&amp;gt;} [calculated_masteritem]),&lt;BR /&gt;'Invalid Period Selection'&lt;BR /&gt;)))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 07:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139631#M92627</guid>
      <dc:creator>Aasir</dc:creator>
      <dc:date>2023-11-21T07:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to call "Master Item" into a formula?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139638#M92629</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/249429"&gt;@Aasir&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thank you for the answer, but the variables and calculations work separately. It works when I add a field from the data instead of the master item. Master Item also brings the correct result, but it does not work when I call it to the formula.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gamze__1-1700552760213.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/120275iBF53E71011768147/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gamze__1-1700552760213.png" alt="Gamze__1-1700552760213.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I changed the domain names when I added it here for clarity, the screenshot shows the original version.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 08:28:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2139638#M92629</guid>
      <dc:creator>Milaf</dc:creator>
      <dc:date>2023-11-22T08:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to call "Master Item" into a formula?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2140423#M92728</link>
      <description>&lt;P&gt;Have to dive deep to check, try square brackets&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 15:37:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2140423#M92728</guid>
      <dc:creator>Aasir</dc:creator>
      <dc:date>2023-11-22T15:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to call "Master Item" into a formula?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2140446#M92730</link>
      <description>&lt;P&gt;You cannot use a master item within an aggregation function. In your post, Sum(calculation_measure) is not allowed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Expressions/references-fields-measures-variables.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Expressions/references-fields-measures-variables.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 16:03:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-call-quot-Master-Item-quot-into-a-formula/m-p/2140446#M92730</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2023-11-22T16:03:09Z</dc:date>
    </item>
  </channel>
</rss>

