Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression

Hi Experts

I want to calculate sales amount based on category and broker name, the difficulty is that every sales number maybe allocate to more than one people, how to calculate sales amount based on category and broker name?(excel file is attached)

my tables are?

     Table1:

Sales numberDateBroker NamePercent
14/5/2017 0:00A50
14/5/2017 0:00B50
23/25/2018 0:00B100
38/4/2016 0:00A60
38/4/2016 0:00C40

Table2:

     

ItemCodeSales_QuantitySales_NetPriceSales_NumberDateSubCatgoriyes
30011002200000038/4/2016 0:00Cover
30021002200000038/4/2016 0:00Cover
30031002200000038/4/2016 0:00Cover
30041001350000038/4/2016 0:00Cover
3005100800000038/4/2016 0:00Cover
40011002200000038/4/2016 0:00Cover
40021002200000038/4/2016 0:00Cover
40031002200000038/4/2016 0:00Cover
40041001350000038/4/2016 0:00Cover
4005100800000038/4/2016 0:00Neck Back
5001100800000038/4/2016 0:00Neck Back
5002100900000038/4/2016 0:00Neck Back
50031001350000038/4/2016 0:00Neck Back
50041001900000038/4/2016 0:00Neck Back
50051001900000038/4/2016 0:00Neck Back
50061001900000038/4/2016 0:00Neck Back
50071001900000038/4/2016 0:00Neck Back
902431004400014/5/2017 0:00Neck Back
90051409200014/5/2017 0:00Neck Back
90071409200014/5/2017 0:00Cover
9008101441500014/5/2017 0:00Cover
9026102511000014/5/2017 0:00Neck Back
902751255500014/5/2017 0:00Neck Back
9001206417000014/5/2017 0:00Neck Back
900351604250014/5/2017 0:00Neck Back
9023103348000014/5/2017 0:00Neck Back
90252669600014/5/2017 0:00Neck Back
3000230015750000023/25/2018 0:00Cover
300031507875000023/25/2018 0:00Phone
300206011940000023/25/2018 0:00Phone
300216011940000023/25/2018 0:00Phone

the answer:

     

Row Labels Sum of Sales_NetPrice ABCABC
Cover                                 343,007,000
1 18,507,000 50%50%0%              9,253,500               9,253,500                            -  
2                                 157,500,000 0%100%0%                             -            157,500,000                            -  
3                                 167,000,000 60%0%40%         100,200,000                              -            66,800,000
Neck Back                                 286,689,500                              -                                -                              -  
1                                 172,189,500 50%50%0%           86,094,750            86,094,750                            -  
3                                 114,500,000 60%0%40%           68,700,000                              -            45,800,000
Phone                                 317,550,000                              -                                -                              -  
2                                 317,550,000 0%100%0%                             -            317,550,000                            -  
Grand Total                                 947,246,500          264,248,250          570,398,250        112,600,000
1 Reply
Lisa_P
Employee
Employee

Load both tables and make sure they are associated on Sales Number - must be exactly the same spelling and case for each table.

You can achieve this by using the expression: Sum(Sales_NetPrice)*Percent/100

When you put this in a pivot table, similar to your answer

pivot.PNG