<?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: Qlikview Pivot and flag in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109810#M90644</link>
    <description>&lt;P&gt;Your real case differs a bit from your origin description because it includes a condition and not for the exists of data else for a the result of a calculation.&lt;/P&gt;
&lt;P&gt;In each case you will need at least two different expressions - one for the rate and one for the count of certain rates. Because of the fact that each expression enforces an own column for a dimension-value you couldn't simply add two expressions else they need to be combined and and you need a separate column to which these results could be plotted. For this you may add a separate dimension-value within your date-dimension or you could enable the partial sums for the date-dimension and then querying the secondarydimensionality() to branch appropriate. For example with something like this:&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;if(secondarydimensionality() &amp;gt; 0,&lt;/P&gt;
&lt;P&gt;Round(Count(DISTINCT&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;STATUS= {'Expensive'},&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;/&lt;BR /&gt;Count(DISTINCT &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;,0.001),&lt;BR /&gt;sum( &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;aggr(if(&lt;BR /&gt;Round(Count(DISTINCT&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;STATUS= {'Expensive'},&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;/&lt;BR /&gt;Count(DISTINCT &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;,0.001) &amp;gt; 0.1, 1), ID, date)))&lt;/P&gt;
&lt;P&gt;An alternatively could be to skip the date-dimension and applying 13 expressions - 12 for your rolling months with appropriate date-filters in the expressions as well as within the labels und within the 13. expression you applying the count of TRUE which will in each case require an aggr() logic.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2023 07:46:53 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2023-08-25T07:46:53Z</dc:date>
    <item>
      <title>Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109117#M90578</link>
      <description>&lt;P&gt;Original Table:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;LVL1&lt;/TD&gt;
&lt;TD width="20%"&gt;LVL2&lt;/TD&gt;
&lt;TD width="20%"&gt;LVL3&lt;/TD&gt;
&lt;TD width="20%"&gt;DATE&lt;/TD&gt;
&lt;TD width="20%"&gt;ITEM&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;1&lt;/TD&gt;
&lt;TD width="20%"&gt;1A&lt;/TD&gt;
&lt;TD width="20%"&gt;1A1&lt;/TD&gt;
&lt;TD width="20%"&gt;01 JAN 23&lt;/TD&gt;
&lt;TD width="20%"&gt;APPLE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;1&lt;/TD&gt;
&lt;TD width="20%"&gt;1A&lt;/TD&gt;
&lt;TD width="20%"&gt;1A1&lt;/TD&gt;
&lt;TD width="20%"&gt;01 JAN 23&lt;/TD&gt;
&lt;TD width="20%"&gt;PEAR&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;1&lt;/TD&gt;
&lt;TD width="20%"&gt;1A&lt;/TD&gt;
&lt;TD width="20%"&gt;1A1&lt;/TD&gt;
&lt;TD width="20%"&gt;01 FEB 23&lt;/TD&gt;
&lt;TD width="20%"&gt;APPLE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%"&gt;1&lt;/TD&gt;
&lt;TD width="20%"&gt;1A&lt;/TD&gt;
&lt;TD width="20%"&gt;1A1&lt;/TD&gt;
&lt;TD width="20%"&gt;01 FEB 23&lt;/TD&gt;
&lt;TD width="20%"&gt;APPLE&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to pivot it and aggregate it to look like this:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;LVL1&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;LVL2&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;LVL3&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;1JAN23&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;1FEB23&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="46px"&gt;#of times Apple appear in the dates&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;1&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;1A&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;1A1&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;=Count(APPLE)&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;=Count(APPLE)&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="24px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that I'm dealing with a lot more LVLs and Dates&lt;/P&gt;
&lt;P&gt;I'm able to Pivot the date field by dragging in the chart with the blue arrow. But how do I get the last field where I want to show the number of times something occur with each date field?&lt;/P&gt;
&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:27:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109117#M90578</guid>
      <dc:creator>fishing_weights</dc:creator>
      <dc:date>2024-11-15T21:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109124#M90579</link>
      <description>&lt;P&gt;You may try an expression like:&lt;/P&gt;
&lt;P&gt;count({&amp;lt; ITEM = {'APPLE'}&amp;gt;} distinct DATE&amp;amp;ITEM)&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2023 17:01:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109124#M90579</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-23T17:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109549#M90609</link>
      <description>&lt;P&gt;This doesn't work. it just returns a value of 0&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:07:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109549#M90609</guid>
      <dc:creator>fishing_weights</dc:creator>
      <dc:date>2023-08-24T14:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109562#M90610</link>
      <description>&lt;P&gt;In regard to your shown example the suggestion should work. What's different to it within your real case?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 14:27:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109562#M90610</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-24T14:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109625#M90621</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see attached. the xlsx is the data i'm loading and in the qvw the object box I've written where I am stuck at.&lt;/P&gt;
&lt;P&gt;Hope this makes things clearer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: The problem statement would be:&lt;/P&gt;
&lt;P&gt;1. For each ID there are items tagged to them&lt;/P&gt;
&lt;P&gt;2. For each item it is labeled "Free" or "Expensive"&lt;/P&gt;
&lt;P&gt;3. Over a rolling 12 months Period&lt;/P&gt;
&lt;P&gt;4. Show the % of Expensive items over the total items of each ID for each date&lt;/P&gt;
&lt;P&gt;5. Count the number of times point 4 is over by 10% and display at the end of the table&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 16:35:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109625#M90621</guid>
      <dc:creator>fishing_weights</dc:creator>
      <dc:date>2023-08-24T16:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109810#M90644</link>
      <description>&lt;P&gt;Your real case differs a bit from your origin description because it includes a condition and not for the exists of data else for a the result of a calculation.&lt;/P&gt;
&lt;P&gt;In each case you will need at least two different expressions - one for the rate and one for the count of certain rates. Because of the fact that each expression enforces an own column for a dimension-value you couldn't simply add two expressions else they need to be combined and and you need a separate column to which these results could be plotted. For this you may add a separate dimension-value within your date-dimension or you could enable the partial sums for the date-dimension and then querying the secondarydimensionality() to branch appropriate. For example with something like this:&lt;/P&gt;
&lt;P&gt;=&lt;BR /&gt;if(secondarydimensionality() &amp;gt; 0,&lt;/P&gt;
&lt;P&gt;Round(Count(DISTINCT&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;STATUS= {'Expensive'},&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;/&lt;BR /&gt;Count(DISTINCT &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;,0.001),&lt;BR /&gt;sum( &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;aggr(if(&lt;BR /&gt;Round(Count(DISTINCT&lt;BR /&gt;{&amp;lt;&lt;BR /&gt;STATUS= {'Expensive'},&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;/&lt;BR /&gt;Count(DISTINCT &lt;BR /&gt;{&amp;lt;&lt;BR /&gt;date={"&amp;gt;=$(=Date(vDate_L13))&amp;lt;=$(=Date(vDate))"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;ITEM)&lt;BR /&gt;,0.001) &amp;gt; 0.1, 1), ID, date)))&lt;/P&gt;
&lt;P&gt;An alternatively could be to skip the date-dimension and applying 13 expressions - 12 for your rolling months with appropriate date-filters in the expressions as well as within the labels und within the 13. expression you applying the count of TRUE which will in each case require an aggr() logic.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2023 07:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2109810#M90644</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-25T07:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview Pivot and flag</title>
      <link>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2111634#M90808</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp; Thanks! I do not fully understand but it works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had to Group the two expressions together and then do a partial sum of the date&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a1.png" style="width: 169px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115439iC0D50AC0F9B5DA79/image-size/large?v=v2&amp;amp;px=999" role="button" title="a1.png" alt="a1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a2.png" style="width: 127px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115440i02D58FF201C74E55/image-dimensions/127x67?v=v2" width="127" height="67" role="button" title="a2.png" alt="a2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This gives me the result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a3.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115441iD088309DD7B8EFC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="a3.png" alt="a3.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 05:57:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qlikview-Pivot-and-flag/m-p/2111634#M90808</guid>
      <dc:creator>fishing_weights</dc:creator>
      <dc:date>2023-08-31T05:57:21Z</dc:date>
    </item>
  </channel>
</rss>

