Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in computing Discounts based on Min and Max limits (by Customer)

We have two data sets. 1. Transactions Data 2. Discount Tiers with Min and Max values

Common fields between two data sets are…

  • C_Year/C_Qtr/Product/Member Type

Based on Customer Number,member type and purchased Quantity (from Transaction Data), we need to comare “Total Purchased Quantity” between MIN and MAX limits in 'Discount Tiers' and extract ‘Tier’ and ‘Discount %’ (from Discount table- 2nd sheet in excel)

Excel with ‘Transaction Data’ and ‘Discount Tiers’ has enclosed (two separate sheets)

Desired output is below….(Yellow form Tran Data and Green from Discount Tiers)

C_YearC_QtrProductCustomer NumberMember TypeQuantity (Sum of Quarter)Discount_TypeTierDiscount%
20144Apple10001AAA80GG_Tier_33
20144Orange10001AAA150GG_Tier_33
20144Banana10001AAA110GG_Tier_33
20144Apple10002BBB120GG_Tier_33
20144Orange10002BBB88GG_Tier_33
20144Banana10002BBB126GG_Tier_33
20144Apple10003CCC98GG_Tier_33

I updated previous thread with more clear data and with clear desired output.

(We have 100 Products and 1000+ customers sales data in our complete data set)

Really appreciate for all your help.

11 Replies
maxgro
MVP
MVP

The problem I have with your data is for every (Transaction Data)  C_Year, C_Qtr, Product, Member_Type

there are 2 matching (range) discount type (G V) in Discount Tires

So when i filter 1 discount type the result seems ok but without filter no (see attachment)

Not applicable
Author

you are awesome!!! Thank you so much for your help. One quick question...can I left join multiple Discount tables to my Transaction table via Intervalmatch? please clarify.