<?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: Empty fields in table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546272#M689908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two tables connected by the field - Item.&lt;/P&gt;&lt;P&gt;Quantity columns are differs. I'm sorry for not clear question. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, I use 2nd table and use fields from 1st to calculate the average cost&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Oct 2013 14:10:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-11T14:10:37Z</dc:date>
    <item>
      <title>Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546269#M689905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table called "Inventory cost" (pic 1)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/47534_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another table called "remained in stock" (pic 2)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/47538_4.png" /&gt;&lt;/P&gt;&lt;P&gt;So, I have to make final table&lt;/P&gt;&lt;P&gt;&lt;IMG alt="3.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/47539_3.png" style="width: 620px; height: 65px;" /&gt;&lt;/P&gt;&lt;P&gt;, where: &lt;/P&gt;&lt;P&gt;quantity in the begining calculated like&lt;/P&gt;&lt;P&gt;RangeSum(&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({$&amp;lt; InOrOut = {0}, DateMovement = {'&amp;lt;=$(vMinSelectedDate)'}, Date &amp;gt;} Quantity),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sum({$&amp;lt; InOrOut = {1}, DateMovement = {'&amp;lt;=$(vMinSelectedDate)'}, Date &amp;gt;} Quantity*(-1))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields Quantity in, out and in the end calculated similarly.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Field "avg cost": &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;avg( aggr(sum(DISTINCT(cost +quantity&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)),Date, Item, DateItemCame))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that some fields in column avg cost is missed. Everything else calculated excellent. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help!&lt;/P&gt;&lt;P&gt;I'm new in qlikview. And sorry for my english)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 12:37:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546269#M689905</guid>
      <dc:creator />
      <dc:date>2013-10-11T12:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546270#M689906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; how the two tables are joined?&lt;/P&gt;&lt;P&gt;I see both item and quantity in the two tables.&lt;/P&gt;&lt;P&gt;I suppose you are working with the data of the secont table and using field from the first is not working fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 12:55:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546270#M689906</guid>
      <dc:creator>bbi_mba_76</dc:creator>
      <dc:date>2013-10-11T12:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546271#M689907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your expression for average cost should look something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;avg(aggr(sum(Quantity / Cost), Item, DateItemCame))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 12:56:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546271#M689907</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-11T12:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546272#M689908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two tables connected by the field - Item.&lt;/P&gt;&lt;P&gt;Quantity columns are differs. I'm sorry for not clear question. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, I use 2nd table and use fields from 1st to calculate the average cost&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:10:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546272#M689908</guid>
      <dc:creator />
      <dc:date>2013-10-11T14:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546273#M689909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've tried to use it. But the result was the same. &lt;/P&gt;&lt;P&gt;I think the problem is with Date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if I not using Date in columns "Quantity on the beginning" and etc the Average column shows everything perfect. But not using Date, the quantity calculates incorrectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546273#M689909</guid>
      <dc:creator />
      <dc:date>2013-10-11T14:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546274#M689910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you like the movement date to relate to the cost date?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546274#M689910</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-11T14:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546275#M689911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Jonathan, for reply.&lt;/P&gt;&lt;P&gt;Actually they are not related. I don't want to relate them. Two tables joined only by "Item". What I want is to take 2nd table as base and take some columns from 1st to calculate the average cost&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546275#M689911</guid>
      <dc:creator />
      <dc:date>2013-10-11T14:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546276#M689912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made a mistake in posting, of course I use spending instead of quantity)..&lt;/P&gt;&lt;P&gt;So I calculate avg cost like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=avg( aggr(sum(DISTINCT(cost +spending&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)),Date, Item, DateItemCame)).. Works fine, but misses some Items. Why???.. I don't understand(&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546276#M689912</guid>
      <dc:creator />
      <dc:date>2013-10-11T14:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546277#M689913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if the quantity, cost and item all come the first table, and the item field has the same name as in the second table, and if it is only key between the two tables, then I see no reason that expression does not work. You might need to post a more detailed example, with the correct field names, so that I can better understand your data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:33:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546277#M689913</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-11T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546278#M689914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Iskander Smagulov wrote:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;So I calculate avg cost like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=avg( aggr(sum(DISTINCT(cost +spending&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)),Date, Item, DateItemCame)).. Works fine, but misses some Items. Why???.. I don't understand(&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont understand what you are trying to calculate with that expression. Using distinct will only consider one cost+spending amount, even if there are several for different items. Perhaps you mean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; avg(aggr(DISTINCT Sum(...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, if either cost or spending is null or is missing, then cost+spending will evaluate to null. So use RangeSum(cost , spending) in place of cost+spending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546278#M689914</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-11T14:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546279#M689915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok!&lt;/P&gt;&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table1 - "Inventory cost":&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;fields - Item, DateCome, QuantityCame, CostCame, Spending1, Spending2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table 2 - "Items movement":&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;fields - Item, DateMovement, InOrOut, QuantityMoved, Stock&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Final table (what I want to see):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Stock, Item, AvgCost, QuantityForTheBeginning, QuantityIn, QuantityOut, QuantityInTheEnd.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, where the problem can sit in my opinion, the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CalendarInventoryCameTemp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;Resident Calendar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (CalendarInventoryCameTemp)&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date as DateCome&lt;/P&gt;&lt;P&gt;Resident Calendar;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;CalendarInventoryCame:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,DateCame&lt;/P&gt;&lt;P&gt;Resident CalendarInventoryCameTemp;&lt;/P&gt;&lt;P&gt;DROP Table CalendarInventoryCameTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same script for DateMovement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:52:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546279#M689915</guid>
      <dc:creator />
      <dc:date>2013-10-11T14:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Empty fields in table</title>
      <link>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546280#M689916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to do as you said, Jonathan, thank you. &lt;/P&gt;&lt;P&gt;But the result is the same. Some items is shown, and some is not. And I don't see the logic there. Because they all have the data in fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My intuition tells me Date making some problems there.&lt;/P&gt;&lt;P&gt;Please, any suggestions. 2nd day of a headache(&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Oct 2013 12:37:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Empty-fields-in-table/m-p/546280#M689916</guid>
      <dc:creator />
      <dc:date>2013-10-12T12:37:21Z</dc:date>
    </item>
  </channel>
</rss>

