<?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: Show 0 for missing dates in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509386#M36360</link>
    <description>I made adjustments to your OccurenceCount expression and presented an alternative solution using the alt() function.&lt;BR /&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load DateKey&lt;BR /&gt;Resident Calendar;&lt;BR /&gt;&lt;BR /&gt;Left Join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;DateKey,&lt;BR /&gt;IF(LEN(Occurence)&amp;gt;0, Occurence,0) AS OccurenceCount,&lt;BR /&gt;Alt(Occurence, 0) as OccurenceCount 2,&lt;BR /&gt;Site&lt;BR /&gt;&lt;BR /&gt;Resident Table1;</description>
    <pubDate>Mon, 19 Nov 2018 22:48:05 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2018-11-19T22:48:05Z</dc:date>
    <item>
      <title>Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509337#M36349</link>
      <description>&lt;P&gt;Please see attached for desired and current result I am getting when trying to show 0 for all dates with missing occurences for a specific site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my current load script:&lt;/P&gt;&lt;P&gt;Noconcatenate&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load&amp;nbsp; &amp;nbsp;DateKey&lt;BR /&gt;Resident Calendar;&lt;/P&gt;&lt;P&gt;Left Join (&lt;SPAN&gt;NewTable&lt;/SPAN&gt;)&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; DateKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF(LEN(Occurence)='-', 0, &lt;SPAN&gt;Occurence&lt;/SPAN&gt;) AS OccurenceCount,&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Site&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident Table1;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 20:52:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509337#M36349</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-19T20:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509386#M36360</link>
      <description>I made adjustments to your OccurenceCount expression and presented an alternative solution using the alt() function.&lt;BR /&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load DateKey&lt;BR /&gt;Resident Calendar;&lt;BR /&gt;&lt;BR /&gt;Left Join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;DateKey,&lt;BR /&gt;IF(LEN(Occurence)&amp;gt;0, Occurence,0) AS OccurenceCount,&lt;BR /&gt;Alt(Occurence, 0) as OccurenceCount 2,&lt;BR /&gt;Site&lt;BR /&gt;&lt;BR /&gt;Resident Table1;</description>
      <pubDate>Mon, 19 Nov 2018 22:48:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509386#M36360</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-19T22:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509401#M36362</link>
      <description>You can also try something like this:&lt;BR /&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load DateKey&lt;BR /&gt;Resident Calendar;&lt;BR /&gt;&lt;BR /&gt;Left Join (NewTable)&lt;BR /&gt;Load&lt;BR /&gt;DateKey,&lt;BR /&gt;IF(Match(Occurence,'-') or Occurence='-' or IsNull (Occurence) or Len(Trim (Occurence))=0, 0, Occurence) AS&lt;BR /&gt;OccurenceCount,&lt;BR /&gt;Site&lt;BR /&gt;Resident Table1;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Nov 2018 01:41:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509401#M36362</guid>
      <dc:creator>Thiago_Justen_</dc:creator>
      <dc:date>2018-11-20T01:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509420#M36367</link>
      <description>&lt;P&gt;where do you want it??&lt;/P&gt;&lt;P&gt;1: Front end (UI)&lt;/P&gt;&lt;P&gt;modify your expression&amp;nbsp;&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;if(trim(Occurance)='-',0,Occurance)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2: In Back End (Script)&lt;/P&gt;&lt;P&gt;NewTable:&lt;BR /&gt;Load&amp;nbsp; &amp;nbsp;DateKey&lt;BR /&gt;Resident Calendar;&lt;/P&gt;&lt;P&gt;Left Join (&lt;SPAN&gt;NewTable&lt;/SPAN&gt;)&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; DateKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Occurence&amp;nbsp;&lt;/SPAN&gt;AS OccurenceCount,&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; Site&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident Table1;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load DateKey,&lt;/P&gt;&lt;P&gt;if(isnull(OccurenceCount) or len(trim(OccurnaceCount))=0,'0',OccuranceCount) as OccuranceCount,&lt;/P&gt;&lt;P&gt;Site&lt;/P&gt;&lt;P&gt;Resident NewTable;&lt;/P&gt;&lt;P&gt;Drop table NewTable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 04:07:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509420#M36367</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2018-11-20T04:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509426#M36370</link>
      <description>&lt;P&gt;Len(Occurrence) always return number format like 0,1...&lt;/P&gt;&lt;P&gt;So, You can think like&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;IF(IsNull(Occurence), 0,&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Occurence) AS OccurenceCount,&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 04:22:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509426#M36370</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-11-20T04:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509784#M36380</link>
      <description>&lt;P&gt;Thank you for the response. I just realized that I did not include the following in my post that is also part of my load script:&lt;/P&gt;&lt;P&gt;NullASValue *;&lt;/P&gt;&lt;DIV&gt;Set NullValue = '-';&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have also tried your suggestion, but I am still not getting the desired output.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you!&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Nov 2018 14:20:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509784#M36380</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-20T14:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509801#M36381</link>
      <description>&lt;P&gt;Thank you for the response to this. I have tried your suggestion, but still getting the same result.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 14:33:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509801#M36381</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-20T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509825#M36382</link>
      <description>&lt;P&gt;Thank you for the response. I do need this in the back end. Your suggestion partially worked, I am now seeing zero for all dates where none of the sites have values, but&amp;nbsp;if one site has a value at a specific date and another site does not, I am only seeing the record for the site with a value. See below more details:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="QlikSupport.PNG" style="width: 641px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/653i7C41594162A7155E/image-size/large?v=v2&amp;amp;px=999" role="button" title="QlikSupport.PNG" alt="QlikSupport.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 14:51:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509825#M36382</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-20T14:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509902#M36387</link>
      <description>You do not have any transactions for your Sites the listed datekeys.&lt;BR /&gt;You could try checking the dimension property "show all values", it might help.&lt;BR /&gt;&lt;BR /&gt;If it is important to present values for all sites every datekeys then I would suggest that you create fake zero-transactions for every Site and datekey. This will ensure you to have a site association to every datekey.</description>
      <pubDate>Tue, 20 Nov 2018 16:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509902#M36387</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-20T16:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509906#M36388</link>
      <description>&lt;P&gt;I know that is my problem, but asking what is the best way to handle it. My main question should really be, Do I add the fake records in the source file outside of Qlik and then load it, or is there anything I can do in the load script to create the missing records?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 16:18:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509906#M36388</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-20T16:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509988#M36392</link>
      <description>It can be done in different ways, a straight forward way is to loop through your dates and Sites. After you have created your Transaction table do this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;FOR each vSite in FieldValueList('Site')&lt;BR /&gt;FOR Each vDateKey in FieldValueList('DateKey')&lt;BR /&gt;Concatenate (Transactions)&lt;BR /&gt;LOAD&lt;BR /&gt;'$(vDateKey)' as DateKey ,&lt;BR /&gt;'$(vSite)' as Site,&lt;BR /&gt;0 as Occurence&lt;BR /&gt;&lt;BR /&gt;Autogenerate 1;&lt;BR /&gt;NEXT vDateKey&lt;BR /&gt;Next vSite&lt;BR /&gt;&lt;BR /&gt;You can make this loop more sophisticated if you please,excluding date-site combinations that do exist, but I think this will do the trick that you are looking for.</description>
      <pubDate>Tue, 20 Nov 2018 19:18:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1509988#M36392</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-20T19:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510023#M36398</link>
      <description>&lt;P&gt;This worked great! Would you please explain to me how this loop actually works? I am a SQL guy and fairly new to Qlik Sense. Also, how would I exclude existing dates with values as you said?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 20:44:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510023#M36398</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-20T20:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510058#M36400</link>
      <description>I'll try to explain.&lt;BR /&gt;&lt;BR /&gt;The two FOR EACH ... IN loops through every unique value of Site and DateKey in your data model.&lt;BR /&gt;The CONCATENATE forces the following LOAD to be added into your Transaction table.&lt;BR /&gt;&lt;BR /&gt;'$(vDateKey)' is the content of the looped DateKey and '$(vSite)' is the content of the looped Site.&lt;BR /&gt;&lt;BR /&gt;AUTOGENERATE tells us how many rows that is created.&lt;BR /&gt;&lt;BR /&gt;The NEXT iterates the next value in the loop.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Nov 2018 22:42:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510058#M36400</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-20T22:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510059#M36401</link>
      <description>A solution for excluding for existing date-store combinations.&lt;BR /&gt;&lt;BR /&gt;1. Add the following field into your transaction table:&lt;BR /&gt;Hash256(Site,DateKey) as SiteDateKey&lt;BR /&gt;&lt;BR /&gt;2. Adjust your zero transaction load statement like this.&lt;BR /&gt;LOAD&lt;BR /&gt;'$(vDateKey)' as DateKey ,&lt;BR /&gt;'$(vSite)' as Site,&lt;BR /&gt;0 as Occurence&lt;BR /&gt;Autogenerate 1&lt;BR /&gt;WHERE&lt;BR /&gt;NOT EXISTS(SiteDateKey, Hash256('$(vSite)' ,'$(vDateKey)' )&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;3. Drop the SiteDateKey field before exiting the load script:&lt;BR /&gt;&lt;BR /&gt;DROP FIELD SiteDateKey;&lt;BR /&gt;&lt;BR /&gt;Edit: changed EXISTS to NOT EXISTS</description>
      <pubDate>Wed, 21 Nov 2018 20:53:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510059#M36401</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-21T20:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510556#M36428</link>
      <description>&lt;P&gt;Thank you Vegar, is it "EXISTS" or "NOT EXISTS"?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 16:30:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510556#M36428</guid>
      <dc:creator>ckchouk123</dc:creator>
      <dc:date>2018-11-21T16:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Show 0 for missing dates</title>
      <link>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510696#M36431</link>
      <description>My bad, it should off course be NOT EXISTS. Thanks for asking.</description>
      <pubDate>Wed, 21 Nov 2018 20:52:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Show-0-for-missing-dates/m-p/1510696#M36431</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2018-11-21T20:52:06Z</dc:date>
    </item>
  </channel>
</rss>

