<?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: Set expressions vs. if statement for keeping all dimension values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-expressions-vs-if-statement-for-keeping-all-dimension-values/m-p/1746532#M57320</link>
    <description>&lt;P&gt;for 1 and 2 , create a table with datecalendar date, and %datekey field and see if you if any place where datecalendar is null...it could be because your datekey is nothing at some place...&lt;/P&gt;&lt;P&gt;for 3 you dont have 1 to 1 mapping between flag/status and date, unless flag and status are dimension it wont work...either use set analysis or put if inside count like count(if(flag='1' and status='A',ID))&lt;/P&gt;</description>
    <pubDate>Wed, 23 Sep 2020 17:16:22 GMT</pubDate>
    <dc:creator>asinha1991</dc:creator>
    <dc:date>2020-09-23T17:16:22Z</dc:date>
    <item>
      <title>Set expressions vs. if statement for keeping all dimension values</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expressions-vs-if-statement-for-keeping-all-dimension-values/m-p/1746531#M57319</link>
      <description>&lt;P&gt;Hello experts, I have a question&amp;nbsp;(example QVF attached) .&lt;/P&gt;&lt;P&gt;I want to have a simple table with dimension &lt;STRONG&gt;DateCalendar&lt;/STRONG&gt;&amp;nbsp;and key figure&lt;STRONG&gt;&amp;nbsp;Count({&amp;lt;Flag={'1'},Status={'A'}&amp;gt;} ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want my dimension &lt;STRONG&gt;DateCalendar&lt;/STRONG&gt;&amp;nbsp; to show all dates from 20200901 to 20200910 without gaps. So I use&amp;nbsp;&lt;STRONG&gt;DateCalendar&amp;nbsp;&lt;/STRONG&gt;as dimension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I use key figure&amp;nbsp;&lt;STRONG&gt;Count({&amp;lt;Flag={'1'},Status={'A'}&amp;gt;} ID)&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;why do I have Null value in my dimension in the table object? I do not have Null value in Dimension in my data&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;gt; Here I only have date value for which I have data in my&amp;nbsp;Data table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I use key figure&amp;nbsp;&lt;STRONG&gt;=if(Flag = 1 AND Status = 'A', Count(ID),0)&amp;nbsp;&lt;/STRONG&gt;and &lt;STRONG&gt;Flag&lt;/STRONG&gt; and &lt;STRONG&gt;Status&lt;/STRONG&gt; fields in my table&lt;/P&gt;&lt;P&gt;-&amp;gt;&amp;nbsp;why do I have Null value in my dimension in the table object? I do not have Null value in Dimension in my data&lt;/P&gt;&lt;P&gt;-&amp;gt; I have all dates as dimension values, that is what I want&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; &amp;nbsp;I use key &lt;STRONG&gt;figure&amp;nbsp;=if(Flag = 1 AND Status = 'A', Count(ID),0)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; I have only correct calculation for date 20200901, that is where I have only one data point, why does my key figure evaluate to 0 for the others?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best solution to have the key figure&amp;nbsp;&lt;STRONG&gt;Count({&amp;lt;Flag={'1'},Status={'A'}&amp;gt;} ID)&amp;nbsp;&lt;/STRONG&gt;and all dimension values for&amp;nbsp;&lt;STRONG&gt;DateCalendar&lt;/STRONG&gt;&amp;nbsp;in a table object?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my Data:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load&lt;BR /&gt;*,&lt;BR /&gt;Date as %DateKey;&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Date, Flag, Status, ID&lt;BR /&gt;20200901, 1, A, 1&lt;BR /&gt;&lt;BR /&gt;20200903, 1, A, 1&lt;BR /&gt;20200903, 1, B, 1&lt;BR /&gt;20200903, 0, A, 1&lt;BR /&gt;&lt;BR /&gt;20200905, 1, A, 1&lt;BR /&gt;20200905, 0, A, 1&lt;BR /&gt;&lt;BR /&gt;2020910, 1, A, 1&lt;BR /&gt;2020910, 1, B, 1&lt;BR /&gt;2020910, 0, A, 1&lt;BR /&gt;2020910, 1, A, 1&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Calendar:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;%DateKey, DateCalendar&lt;BR /&gt;20200901, 20200901&lt;BR /&gt;20200902, 20200902&lt;BR /&gt;20200903, 20200903&lt;BR /&gt;20200904, 20200904&lt;BR /&gt;20200905, 20200905&lt;BR /&gt;20200906, 20200906&lt;BR /&gt;20200907, 20200907&lt;BR /&gt;20200908, 20200908&lt;BR /&gt;20200909, 20200909&lt;BR /&gt;20200910, 20200910&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eddy&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:24:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expressions-vs-if-statement-for-keeping-all-dimension-values/m-p/1746531#M57319</guid>
      <dc:creator>Eddy</dc:creator>
      <dc:date>2024-11-16T01:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set expressions vs. if statement for keeping all dimension values</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expressions-vs-if-statement-for-keeping-all-dimension-values/m-p/1746532#M57320</link>
      <description>&lt;P&gt;for 1 and 2 , create a table with datecalendar date, and %datekey field and see if you if any place where datecalendar is null...it could be because your datekey is nothing at some place...&lt;/P&gt;&lt;P&gt;for 3 you dont have 1 to 1 mapping between flag/status and date, unless flag and status are dimension it wont work...either use set analysis or put if inside count like count(if(flag='1' and status='A',ID))&lt;/P&gt;</description>
      <pubDate>Wed, 23 Sep 2020 17:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expressions-vs-if-statement-for-keeping-all-dimension-values/m-p/1746532#M57320</guid>
      <dc:creator>asinha1991</dc:creator>
      <dc:date>2020-09-23T17:16:22Z</dc:date>
    </item>
  </channel>
</rss>

