<?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: YTD-Values in Pivot-Table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030488#M84873</link>
    <description>&lt;P&gt;Boris,&lt;/P&gt;
&lt;P&gt;I found another way by using a dimension that combines Date and YTD. However, this is more difficult to set up. In the script, you have to create a special calendar table that includes YTD and Date.&lt;BR /&gt;For example we could have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Date_Key&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Type_Calendar&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Date_Selection&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Special_Dim&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;N&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;20/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;19/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;18/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;17/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;16/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for this method, you will have to create as many "Type Calendar" as there are different YTD's.&lt;BR /&gt;Here we link to the main table with Date_Key and in the app we select the date with Date_selection. &lt;BR /&gt;For exexample,&lt;BR /&gt;If you select 21/04/2022 in Date_selection and the type N it will show data for 21/04/2022&lt;BR /&gt;If you select 21/04/2022 in Date_Selection and the type YTD it will show data for 01/01/2022 to 21/04/2022&lt;BR /&gt;And it works I tried:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Steven35_2-1674751838013.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98951i362F32F3CFECDDA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Steven35_2-1674751838013.png" alt="Steven35_2-1674751838013.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you will understand,&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 16:50:48 GMT</pubDate>
    <dc:creator>Steven35</dc:creator>
    <dc:date>2023-01-26T16:50:48Z</dc:date>
    <item>
      <title>YTD-Values in Pivot-Table</title>
      <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030331#M84855</link>
      <description>&lt;P&gt;Hello, everyone,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I'm new here.&lt;BR /&gt;I have a question about how the data is shown in a pivot table.&lt;BR /&gt;I need to show certain measures under date dimension. When I select a day (Dimension "Datum"), the metrics in the table must be presented for the last 7 days (&lt;BR /&gt;see example).&lt;BR /&gt;I did that with the following formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sum({&amp;lt;[Datum] = {"&amp;gt;$(=Date(Max([Datum])- 7)) &amp;lt;=$(=Max([Datum]))"}&amp;gt;} [PCA_COUNT])&lt;/LI-CODE&gt;
&lt;P&gt;But I also have to show the following measures figures in the same table (in the example file are measures marked in yellow)&lt;BR /&gt;1. YTD for the selected day - 8 days (if the YTD measure is in the previous year, then no values) &amp;nbsp;&lt;BR /&gt;2. YTD for the Selected Day&lt;BR /&gt;3. YTD for the selected day but previous year&lt;/P&gt;
&lt;P&gt;Is that possible?&lt;BR /&gt;It would be very grateful, if you could answer the questions.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Boris&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 12:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030331#M84855</guid>
      <dc:creator>BorisM</dc:creator>
      <dc:date>2023-01-26T12:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: YTD-Values in Pivot-Table</title>
      <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030374#M84861</link>
      <description>&lt;P&gt;Hi Boris,&lt;/P&gt;
&lt;P&gt;I think it is possible but each measure (Measure 1, Measure 2, Measure3) would have to be in dimension, and the values in column would have to be the measures.&lt;BR /&gt;Let me explain. First create a Measure table in the script.&lt;/P&gt;
&lt;P&gt;For instance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measures:
LOAD * Inline [
Measure
1
2
3
];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put"Measure" in the row dimension of the pivot table.&lt;/P&gt;
&lt;P&gt;Then, for each of the 10 columns, you have to put in the Analysis set(here it is for the first column for instance):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pick( Measure,
// Measure 1
	Sum({&amp;lt;Datum={"&amp;gt;=$(=YearStart([Datum]))&amp;lt;=$(=Date(Max([Datum])- 7))"} &amp;gt;}Value),  

// Measure 2
	Avg({&amp;lt;Datum={"&amp;gt;=$(=YearStart([Datum]))&amp;lt;=$(=Date(Max([Datum])- 7))"} &amp;gt;}Value),
    
// Measure 3
	Max({&amp;lt;Datum={"&amp;gt;=$(=YearStart([Datum]))&amp;lt;=$(=Date(Max([Datum])- 7))"} &amp;gt;}Value))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You will have to do this in the 10 column and change the filters in set analysis for each as you want.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Steven35_0-1674740625242.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98927i4C8E77B237226382/image-size/large?v=v2&amp;amp;px=999" role="button" title="Steven35_0-1674740625242.png" alt="Steven35_0-1674740625242.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope that's clear enough,&lt;BR /&gt;&lt;BR /&gt;Steven&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:10:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030374#M84861</guid>
      <dc:creator>Steven35</dc:creator>
      <dc:date>2023-01-26T14:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: YTD-Values in Pivot-Table</title>
      <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030423#M84867</link>
      <description>&lt;P&gt;Hello Steven,&lt;/P&gt;
&lt;P&gt;thank you very much for your quick answer.&lt;BR /&gt;I think the solution is very cool.&lt;BR /&gt;The problem is that I have to build about 15 measures. In addition, I have to display the data for 14 days + YTDs (7 days was just an example).&lt;BR /&gt;There is a possibility that the solution is in the analysis layer. For example with dynamic dimensions...&lt;BR /&gt;P.S. The app is relatively large. The QVD file is around 6GB.&lt;BR /&gt;The app update needs to be fast so there can't be complex logic in scripts.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Boris&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 15:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030423#M84867</guid>
      <dc:creator>BorisM</dc:creator>
      <dc:date>2023-01-26T15:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: YTD-Values in Pivot-Table</title>
      <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030488#M84873</link>
      <description>&lt;P&gt;Boris,&lt;/P&gt;
&lt;P&gt;I found another way by using a dimension that combines Date and YTD. However, this is more difficult to set up. In the script, you have to create a special calendar table that includes YTD and Date.&lt;BR /&gt;For example we could have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;Date_Key&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Type_Calendar&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Date_Selection&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;Special_Dim&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;N&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;20/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;19/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;18/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;17/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;16/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;21/04/2022&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;YTD&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for this method, you will have to create as many "Type Calendar" as there are different YTD's.&lt;BR /&gt;Here we link to the main table with Date_Key and in the app we select the date with Date_selection. &lt;BR /&gt;For exexample,&lt;BR /&gt;If you select 21/04/2022 in Date_selection and the type N it will show data for 21/04/2022&lt;BR /&gt;If you select 21/04/2022 in Date_Selection and the type YTD it will show data for 01/01/2022 to 21/04/2022&lt;BR /&gt;And it works I tried:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Steven35_2-1674751838013.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/98951i362F32F3CFECDDA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Steven35_2-1674751838013.png" alt="Steven35_2-1674751838013.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you will understand,&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 16:50:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030488#M84873</guid>
      <dc:creator>Steven35</dc:creator>
      <dc:date>2023-01-26T16:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: YTD-Values in Pivot-Table</title>
      <link>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030795#M84902</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Steven, &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;understood. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your enlightenment. If it doesn't work in the Analys layer, I try to reformulate the request so that the YTD values ​​are not presented in a table with date fields.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Boris.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 11:33:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/YTD-Values-in-Pivot-Table/m-p/2030795#M84902</guid>
      <dc:creator>BorisM</dc:creator>
      <dc:date>2023-01-27T11:33:57Z</dc:date>
    </item>
  </channel>
</rss>

