<?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: Mapping price discount based on product category in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1578455#M42161</link>
    <description>&lt;P&gt;Forgot to update, but... Solved!&lt;/P&gt;&lt;P&gt;I just had to do a proper ApplyMap() in my fact table.&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2019 13:04:27 GMT</pubDate>
    <dc:creator>valpassos</dc:creator>
    <dc:date>2019-05-09T13:04:27Z</dc:date>
    <item>
      <title>Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558060#M40636</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;I'm in a retail project. I have merchandise (products) to which I need to apply a volume discount, based on the category of the product.&lt;BR /&gt;I have a ProductCategory table, like the following:&lt;/P&gt;&lt;PRE&gt;ProductCategory:
- ID_Category (100, 101, 102,...)
- Name
- Description
- Classification
- DiscountType (this is the new field I introduced that groups me the products based on family to which apply the volume discount). It takes the values 1 or 2. &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my Volume_Discount_2018 file I have the following fields:&lt;/P&gt;&lt;PRE&gt;Volume_Discount_2018:
- ID_Client (Id of the client that sold that category of product)
- ID_ProductCategory (links to the ID_Category of the ProductCategory table)
- Year
- Discount (actual value of the volume discount)&lt;/PRE&gt;&lt;P&gt;I need to implement this rule:&lt;BR /&gt;&lt;STRONG&gt;- If there exists, in the Volume_Discount_2018, a client with the ID_ProductCategory = 000, then the volume discount should be applied to all products sold by that client, regardless of category.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;- If not, then we have a category-based discount (1 or 2), depending on what we have in the DiscountType column.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble implementing this rule in my facts table. I've already prepared the ProductCategory to partiton my category groups with the field DiscountType, that takes the value 1 or 2.&lt;BR /&gt;Now, how should I link this DiscountType with the info coming from Volume_Discount_2018 table? And what ApplyMap should I do in my facts table? I'm missing the final step!&lt;/P&gt;&lt;P&gt;Thanks in advance, folks!&lt;/P&gt;&lt;P&gt;Lisa&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:18:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558060#M40636</guid>
      <dc:creator>valpassos</dc:creator>
      <dc:date>2024-11-16T06:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558188#M40649</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;If i understand correctly, you need to add this steps:&lt;/P&gt;&lt;PRE&gt;ClientsWithPC000:  // table of clients that sold prod cat 000&lt;BR /&gt;LOAD&lt;BR /&gt;ID_Client,&lt;BR /&gt;ID_ProductCategory&lt;BR /&gt;RESIDENT&lt;BR /&gt;Volume_Discount_2018&lt;BR /&gt;WHERE ID_ProductCategory = '000';&lt;BR /&gt;&lt;BR /&gt;JOIN(Volume_Discount_2018) LOAD   // add field by client ID &lt;BR /&gt;ID_Client,&lt;BR /&gt;'1' AS ApplyDiscount // mark clients &lt;SPAN&gt;to apply a volume discount as 1&lt;/SPAN&gt;&lt;BR /&gt;RESIDENT ClientsWithPC000;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE ClientsWithPC000;&lt;/PRE&gt;&lt;P&gt;and finally Load and check&amp;nbsp;ApplyDiscount&amp;nbsp; condition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 04:34:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558188#M40649</guid>
      <dc:creator>Zhandos_Shotan</dc:creator>
      <dc:date>2019-03-19T04:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558379#M40659</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41787"&gt;@Zhandos_Shotan&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help, but I'm not exactly getting the purpose of the Join...&lt;/P&gt;&lt;P&gt;How are you dealing with the discount types 1 and 2?&lt;/P&gt;&lt;P&gt;I currently have these mappings in my dimensions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Map_ClientProdToVolumeDiscount&lt;/STRONG&gt;:&lt;BR /&gt;MAPPING
LOAD
ID_Client &amp;amp; ID_ProductCategory &amp;amp; Year,
Discount
&lt;STRONG&gt;Resident Volume_Discount_2018&lt;/STRONG&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;STRONG&gt;Map_ProdCategoryToDiscountType&lt;/STRONG&gt;:
MAPPING
LOAD
ID_ProductCategory,
DiscountType
&lt;STRONG&gt;RESIDENT ProductCategory&lt;/STRONG&gt;;&lt;/PRE&gt;&lt;P&gt;The problem now is, what to do with these mappings in my factual table? How do I incorporate the codes (000, 1 or 2) logic there?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Lisa&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 14:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558379#M40659</guid>
      <dc:creator>valpassos</dc:creator>
      <dc:date>2019-03-19T14:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558412#M40662</link>
      <description>Join is for adding additional field to indicate Clients who have to have Volume discount.&lt;BR /&gt;If your volume discount code is '999', then redefine DiscountType by condition:&lt;BR /&gt;&lt;BR /&gt;If(ApplyDiscount =' 1', '999', DiscountType) as DiscountType</description>
      <pubDate>Tue, 19 Mar 2019 12:14:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558412#M40662</guid>
      <dc:creator>Zhandos_Shotan</dc:creator>
      <dc:date>2019-03-19T12:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558506#M40680</link>
      <description>&lt;P&gt;Where are you defining that condition, &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/41787"&gt;@Zhandos_Shotan&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;&lt;PRE&gt;If(ApplyDiscount ='1', '000', DiscountType) as DiscountType&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;In the &lt;STRONG&gt;ProductCategory&lt;/STRONG&gt; table, &lt;STRONG&gt;Volume_Discount_2018&lt;/STRONG&gt; table or &lt;STRONG&gt;fact table&lt;/STRONG&gt; (my sales data)&lt;FONT size="4"&gt;?&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having problem understanding the relationship.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my &lt;STRONG&gt;Volume_Discount 2018 &lt;/STRONG&gt;table, I have the field &lt;STRONG&gt;ID_ProductCategory&lt;/STRONG&gt; that takes the values: &lt;STRONG&gt;000&lt;/STRONG&gt;, 101, 102, 103,... where &lt;STRONG&gt;000&lt;/STRONG&gt; takes a special meaning, and the others are the typical identifier for each Product Category, which I need to convert to 1 or 2 based on the &lt;STRONG&gt;ProductCategory&lt;/STRONG&gt; table (for example, i&lt;/SPAN&gt;f ID_Category = 101, then DiscountType = 1... I have the mapping in order that gives me this).&lt;/P&gt;&lt;P&gt;The problem now is to actually implement the rule in the fact table! This rule:&lt;/P&gt;&lt;PRE&gt;IF there exists a line in my&amp;nbsp;Volume_Discount_2018 table with Client ID &amp;amp; '000' &amp;amp; Year, then direct discount,
ELSE, grab the discount associated with 1 or 2 DiscountType&lt;/PRE&gt;&lt;P&gt;Am I making myself clear?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 14:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1558506#M40680</guid>
      <dc:creator>valpassos</dc:creator>
      <dc:date>2019-03-19T14:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping price discount based on product category</title>
      <link>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1578455#M42161</link>
      <description>&lt;P&gt;Forgot to update, but... Solved!&lt;/P&gt;&lt;P&gt;I just had to do a proper ApplyMap() in my fact table.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 13:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Mapping-price-discount-based-on-product-category/m-p/1578455#M42161</guid>
      <dc:creator>valpassos</dc:creator>
      <dc:date>2019-05-09T13:04:27Z</dc:date>
    </item>
  </channel>
</rss>

