<?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 Changing Selling Price Based on Date in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2433815#M96846</link>
    <description>&lt;P&gt;Hello, I have recently spotted an issue within one my applications.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column that has Selling Price and a column that Confirmation Date. Selling Price can change monthly, so I need the Selling Price to reflect the correct price based on the Confirmation Date column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example to illustrate the issue. Let's say Selling Price for part A in January is $1000 and Selling Price for part A in February is $2000 dollars.&amp;nbsp; I want that Selling Price column to look at the Confirmation date column and see that Confirmation date was 2/xx/2024 or 1/xx/2024 and reflect those correct prices. I will include some screenshots for aid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the excel sheet that pulls the Selling Price Data. This is just an example of one part, but every part is set up the same way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_0-1711118858005.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162564iE7FF78D02C88A72F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_0-1711118858005.png" alt="Drecegkn_0-1711118858005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This next screenshot is from the table visualization within the application that has the Confirmation Date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_1-1711119102907.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162565i7C61CF48D0C801D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_1-1711119102907.png" alt="Drecegkn_1-1711119102907.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So basically, what I think at least, I need Confirmation Date column to look at the MonthYear column and compare, then report back the correct Selling Price associated to that month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 14:55:06 GMT</pubDate>
    <dc:creator>Drece-gkn</dc:creator>
    <dc:date>2024-03-22T14:55:06Z</dc:date>
    <item>
      <title>Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2433815#M96846</link>
      <description>&lt;P&gt;Hello, I have recently spotted an issue within one my applications.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column that has Selling Price and a column that Confirmation Date. Selling Price can change monthly, so I need the Selling Price to reflect the correct price based on the Confirmation Date column.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example to illustrate the issue. Let's say Selling Price for part A in January is $1000 and Selling Price for part A in February is $2000 dollars.&amp;nbsp; I want that Selling Price column to look at the Confirmation date column and see that Confirmation date was 2/xx/2024 or 1/xx/2024 and reflect those correct prices. I will include some screenshots for aid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the excel sheet that pulls the Selling Price Data. This is just an example of one part, but every part is set up the same way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_0-1711118858005.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162564iE7FF78D02C88A72F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_0-1711118858005.png" alt="Drecegkn_0-1711118858005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This next screenshot is from the table visualization within the application that has the Confirmation Date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_1-1711119102907.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162565i7C61CF48D0C801D2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_1-1711119102907.png" alt="Drecegkn_1-1711119102907.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So basically, what I think at least, I need Confirmation Date column to look at the MonthYear column and compare, then report back the correct Selling Price associated to that month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 14:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2433815#M96846</guid>
      <dc:creator>Drece-gkn</dc:creator>
      <dc:date>2024-03-22T14:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2433926#M96853</link>
      <description>&lt;P&gt;technically speaking I understand what you want&lt;BR /&gt;but the sample data is not informative:&lt;BR /&gt;we have two confirmation dates repeated with the same selling price&lt;BR /&gt;Ok I assume I take the distinct rows:&lt;BR /&gt;but I will end with 2 lines&lt;BR /&gt;03/21/2024 1,700&lt;BR /&gt;03/21/2024 2,132&lt;BR /&gt;&lt;BR /&gt;so same confirmation date for the same part with 2 different prices&lt;BR /&gt;&lt;BR /&gt;ok out of this sample data what do you want as a result so that I can figure out how to accomplish it&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 07:08:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2433926#M96853</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2024-03-23T07:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434128#M96876</link>
      <description>&lt;P&gt;From what you've shared, I assume this is what your data model (at least the relevant part) currently looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_0-1711352532575.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162620i270DD0A305E7FF0D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_0-1711352532575.png" alt="LRuCelver_0-1711352532575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Instead of just using the product as a key, you can create a composite key using the Product and MonthYear. In the Sales table you can create a MonthYear from the Confirmation Date:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_1-1711352722416.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162621i41FDEB54246280D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_1-1711352722416.png" alt="LRuCelver_1-1711352722416.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now ideally you would be using numeric keys. You can use&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/February2024/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegularStatements/Autonumber.htm" target="_blank"&gt;AutoNumber&lt;/A&gt;&amp;nbsp;for that.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 07:47:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434128#M96876</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-25T07:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434233#M96878</link>
      <description>&lt;P&gt;I will give a much specific sample data, filtering it by only 1 part. As you see for this part we have two different Selling Prices. If you look at the Selling Price Excel, the only time the Selling Price should reflect as $7440 is in Jan. So, this Table shouldn't be reading both possible Selling Prices. The Confirmation date is 3/xx/24, so it should only reflect $9466.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_0-1711369186942.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162643i66E058543EBF1F90/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_0-1711369186942.png" alt="Drecegkn_0-1711369186942.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Drecegkn_1-1711369243739.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/162644iD51DBD840D64A8E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Drecegkn_1-1711369243739.png" alt="Drecegkn_1-1711369243739.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:23:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434233#M96878</guid>
      <dc:creator>Drece-gkn</dc:creator>
      <dc:date>2024-03-25T12:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434249#M96879</link>
      <description>&lt;P&gt;It looks like the Confirmation Date is not linked to to Selling Price MonthYear.&lt;/P&gt;
&lt;P&gt;If you select a single Confirmation Date, how many MonthYears can you see?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 12:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434249#M96879</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-25T12:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434393#M96893</link>
      <description>&lt;P&gt;You're right, Confirmation Date comes from a separate data connection while Selling Price and MonthYear are from another Data connection excel sheet. The only link they have is a left join with my other tables and its joined together by Material Number (part). Which I don't think helps associate Confirmation Date and Month Year together!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I selected a single month year, and I am able to just freely filter by whatever month I want. So, for example, I filtered by 3/19/2024 and none of the months in MonthYear Filter Pane were greyed out. So, I can just basically filter by whatever month I want, which is not good. How would I create that link between them?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2024 18:10:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434393#M96893</guid>
      <dc:creator>Drece-gkn</dc:creator>
      <dc:date>2024-03-25T18:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Selling Price Based on Date</title>
      <link>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434558#M96901</link>
      <description>&lt;P&gt;You can derive a MonthYear from the Confirmation Date field:&lt;/P&gt;
&lt;PRE&gt;Date(MonthStart([Confirmation Date]), 'MMM-YY') as MonthYear&lt;/PRE&gt;
&lt;P&gt;If you now join the tables you can join them on the&amp;nbsp;&lt;SPAN&gt;Material Number and MonthYear, linking the Selling Price to both.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you instead want to keep them as seperate tables, having both&amp;nbsp;Material Number and MonthYear in both tables will create a synthetic key.&lt;BR /&gt;This can be avoided by creating a composite key:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the selling price table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;[Material Number] &amp;amp; '|' &amp;amp; MonthYear as Key_SellingPrice&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;In the materials table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;[Material Number] &amp;amp; '|' &amp;amp; Date(MonthStart([Confirmation Date]), 'MMM-YY') as Key_SellingPrice&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;To help with performance it is recommended to use numeric keys. To make this key numeric, we can use AutoNumber at the end of the script:&lt;/P&gt;
&lt;PRE&gt;AutoNumber&amp;nbsp;&lt;SPAN&gt;Key_SellingPrice;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;While you could also use the AutoNumber() function to make the numeric while loading it into the table, using the&amp;nbsp;AutoNumber keyword outside of the table has the advantage that you can comment it, leaving the key in its "raw" form. This makes it a lot easier to debug the keys.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 06:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Changing-Selling-Price-Based-on-Date/m-p/2434558#M96901</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-26T06:48:41Z</dc:date>
    </item>
  </channel>
</rss>

