<?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: Changing date values in expressions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204960#M876520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have flags created for individual date fields in your script? May be you can add the date_type_flag to your expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2016 17:03:22 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-10-19T17:03:22Z</dc:date>
    <item>
      <title>Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204959#M876519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a reporting issue which I hope you chaps will be able to assist with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data model has three streams of data which each have a unique date - there is a master calendar created with date type (such as &lt;A href="https://community.qlik.com/qlik-blogpost/3585" target="_blank"&gt;Canonical Date&lt;/A&gt;) - the three dates are inwards_date, production_date and delivery_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a report where I need to use data from the production table and the sales table and report against the delivery_date (such as below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum( //raw material cost from production for product sold&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({$&amp;lt; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Customer, // from sales table&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt;"&gt; [Production Consignment Line] = P([Production Consignment Line]), // from production table but matches data in sales table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(function.clear_selections(dimension.calendar)) //function to remove all date filters to allow production data to return if different date&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Cost Raw Material Amount]) //from production table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUM(&lt;SPAN style="font-size: 10pt;"&gt; [Sales Quantity]) // from sales table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression is working correctly and returning the right result - unfortunately it is returning the results according to the delivery_date for the sales table data for the sales element and the production_date for the production table data.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example if production was on day 1 and the item was despatched on day 2 then my results look like the below (for the 11/09/2016 the results are 0*88, for the 12/09/2016 the results are 454.08*0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/141190_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to report against delivery_date.&amp;nbsp; Is there a way to force / change the date IN THE EXPRESSION so that the production data is returned against delivery_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please note that I do not want to amend the data nor the script itself as I need to report against production date in other areas, I just want to amend it in this specific expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204959#M876519</guid>
      <dc:creator>stig1984</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204960#M876520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have flags created for individual date fields in your script? May be you can add the date_type_flag to your expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 17:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204960#M876520</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-19T17:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204961#M876521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We do have the flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link calendar has the field 'Date Type' with flags for 'Delivery Date' (sales date) and 'Production Date' (for production).&amp;nbsp; I need the expression to either:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a) ignore production date so that all data is returned against delivery date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b) change the production date to match the delivery date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried it with the set modifier &lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; [Date Type] = {'Delivery Date'}, in the expression against each element and just against the sum(sales qty) but with the same result as above.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 07:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204961#M876521</guid>
      <dc:creator>stig1984</dc:creator>
      <dc:date>2016-10-20T07:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204962#M876522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Difficult to say what might be wrong without looking at a sample, would you be able to share one?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2016 16:24:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204962#M876522</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-20T16:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204963#M876523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately there is a lot of sensitive data in the model so I'll need to try to build a replica and mirror the issue first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2016 09:18:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204963#M876523</guid>
      <dc:creator>stig1984</dc:creator>
      <dc:date>2016-10-24T09:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204964#M876524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this link helps:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1290"&gt;Preparing examples for Upload - Reduction and Data Scrambling&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2016 14:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204964#M876524</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-10-24T14:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Changing date values in expressions</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204965#M876525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your assistance and especially for the link above - this will be really useful for the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We've worked around this issue by using by aggr() function by production consignment line such as below.&amp;nbsp; Needed to use this function to resolve a separate issue but it had the happy co-incidence of fixing this problem as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; (sum({$&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Sales Invoice Number],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Invoice Consignment Line],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Consignment Line] = P([Production Consignment Line]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(function.clear_selections(dimension.calendar))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Cost Raw Material Amount])&lt;/P&gt;&lt;P&gt;&amp;nbsp; /&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({$&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Customer,&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Sales Invoice Number],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Invoice Consignment Line],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Consignment Line] = P([Production Consignment Line]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(function.clear_selections(dimension.calendar))&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Quantity by Raw Material]))&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; SUM({$&amp;lt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Date Type] = {'Delivery Date'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Sales Document Type] = {'Sales Invoice'},&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Product Class Id] = {1,7,10}&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Sales Quantity]),&lt;/P&gt;&lt;P&gt;&amp;nbsp; [Production Consignment Line]))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2016 10:49:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-date-values-in-expressions/m-p/1204965#M876525</guid>
      <dc:creator>stig1984</dc:creator>
      <dc:date>2016-10-26T10:49:44Z</dc:date>
    </item>
  </channel>
</rss>

