<?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 set analysis column calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504297#M481135</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;Hi everyone!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;I need some help on summarizing days which our delivery date differ close date. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Here is the task:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if wanted delivery date is '-' skip the record, then if wanted delivery date is greater than close date of shop order then the number of late days = 0, if wanted delivery date is less than close date of shop order then calculate the number of late days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;[WANTED_DELIVERY_DATE] and [&lt;SPAN style="font-style: inherit;"&gt;CLOSE_DATE] are &lt;SPAN style="font-style: inherit;"&gt;fields from &lt;/SPAN&gt;separated tables. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit;"&gt;So that's why i trying to use Set Analysis, but i facing incorrect calculations when using expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=sum({$&amp;lt;[WANTED_DELIVERY_DATE]-={"$(=isnull(WANTED_DELIVERY_DATE))"},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; [WANTED_DELIVERY_DATE]={"&amp;gt;$(=date(DayStart(CLOSE_DATE)))"}&amp;gt;} $())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vDateDiff=Interval(date(DayStart(CLOSE_DATE))-date(WANTED_DELIVERY_DATE),'d')&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;But, when i'm typing&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[WANTED_DELIVERY_DATE]={"&amp;gt;$(=date(DayStart(2013-09-04)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;everything goes perfect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Could you tell me what is wrong?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Appreciate answers and assumes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Oct 2013 12:40:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-10-22T12:40:37Z</dc:date>
    <item>
      <title>set analysis column calculation</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504297#M481135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;Hi everyone!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;I need some help on summarizing days which our delivery date differ close date. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Here is the task:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if wanted delivery date is '-' skip the record, then if wanted delivery date is greater than close date of shop order then the number of late days = 0, if wanted delivery date is less than close date of shop order then calculate the number of late days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-style: inherit; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;[WANTED_DELIVERY_DATE] and [&lt;SPAN style="font-style: inherit;"&gt;CLOSE_DATE] are &lt;SPAN style="font-style: inherit;"&gt;fields from &lt;/SPAN&gt;separated tables. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit;"&gt;So that's why i trying to use Set Analysis, but i facing incorrect calculations when using expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-style: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=sum({$&amp;lt;[WANTED_DELIVERY_DATE]-={"$(=isnull(WANTED_DELIVERY_DATE))"},&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; [WANTED_DELIVERY_DATE]={"&amp;gt;$(=date(DayStart(CLOSE_DATE)))"}&amp;gt;} $())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;where&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vDateDiff=Interval(date(DayStart(CLOSE_DATE))-date(WANTED_DELIVERY_DATE),'d')&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;But, when i'm typing&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[WANTED_DELIVERY_DATE]={"&amp;gt;$(=date(DayStart(2013-09-04)))"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;everything goes perfect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Could you tell me what is wrong?&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Appreciate answers and assumes!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 12:40:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504297#M481135</guid>
      <dc:creator />
      <dc:date>2013-10-22T12:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis column calculation</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504298#M481136</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 assume that you are trying to use this calculation in a table or chart, and that WANTED_DELIVERY_DATE and CLOSE_DATE are two fields that are associated with each other (a key between the tables):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you cannot do this using set expressions. The set expression is evaluated outside the context of the table (ie before the table is built) and has no knowledge of the dimensions. So simply referencing CLOSE_DATE will return null. When you enter a literal date, QV can evaluate this correctly as you have seen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do this using sumif...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum(If([WANTED_DELIVERY_DATE]&amp;gt;CLOSE_DATE, $(vDateDiff)))&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>Tue, 22 Oct 2013 12:54:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504298#M481136</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-22T12:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis column calculation</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504299#M481137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dankie &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jonathan, got the right results.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Well, i have changed [WANTED_DELIVERY_DATE]={"&amp;gt;$(date(DayStart(CLOSE_DATE)))"}&amp;gt;} $(vDateDiff)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;(removed "=" sign) and it also worked fine(haven't tested).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;i have one more question to you-where can i read all the "Logic and architecture stuff" about QV, i mean something like as you said "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The set expression is evaluated outside the context of the table"&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 13:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504299#M481137</guid>
      <dc:creator />
      <dc:date>2013-10-22T13:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis column calculation</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504300#M481138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When QV calculates a table, it evaluates the table expressions for each combination of the dimensions of the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use an aggregation expression (eg sum(), min(), max(), etc), then QV can evaluate that for each row of a table, and also for the total row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use just a field name in an expression without an aggregation, QV may be able to evaluate the expression if and only if there is only one possible value for that field in the context in which the expression runs. The context may be a row calculation in a table, a partial total, a total or outside of the table, in a text box for example). If there is more than one possible value in that context, then the expression will return null, as QV cannot determine which of the possible values to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set expressions are evaluated outside the context of the table - or, if it is easier to understand, before the table dimensions are calculated. This similar to evaluating the expression in a text box. Therefore, if a set expression refers to a non-aggregated field on the RHS of the expression, it will only work if there is only one possible value for that field, for example, by selecting a value in a list box. If there is more than one possible value, the set expression will fail. The chart expression may calculate, but the result will be as if the set expression was not there at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that clarifies it rather than confusing you further &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 14:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504300#M481138</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-10-22T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: set analysis column calculation</title>
      <link>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504301#M481139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jon,&lt;/P&gt;&lt;P&gt;i actually had one value for each record, so that worked fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer and i appreciate your explanation on how QV works.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 15:48:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/set-analysis-column-calculation/m-p/504301#M481139</guid>
      <dc:creator />
      <dc:date>2013-10-31T15:48:28Z</dc:date>
    </item>
  </channel>
</rss>

