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: 
Not applicable

How To Calculate Item Wise Discount

I Have a Total DIscount Amount 500, And I Sale Three Item.

1.Item 1 Price - 2000.00

2.Item 2 Price - 1500.00

3.Item 3 Price - 2500.00

How To Calculate The Discount Amount Itemwise.

Result Should Be Like This:

1.Item 1 Price - 2000.00 Discount - 166.67

2.Item 2 Price - 1500.00 Discount - 125.00

3.Item 3 Price - 2500.00 Discount - 208.33

1 Solution

Accepted Solutions
whiteline
Master II
Master II

1.Item 1 Price - 2000.00 Discount - 166.67 = 500*2000/(2000+1500+2500)

2.Item 2 Price - 1500.00 Discount - 125.00 = 500*1500/(2000+1500+2500)

3.Item 3 Price - 2500.00 Discount - 208.33 = 500*2500/(2000+1500+2500)

=TotalDiscount * Price / Sum (total Price)

View solution in original post

2 Replies
whiteline
Master II
Master II

1.Item 1 Price - 2000.00 Discount - 166.67 = 500*2000/(2000+1500+2500)

2.Item 2 Price - 1500.00 Discount - 125.00 = 500*1500/(2000+1500+2500)

3.Item 3 Price - 2500.00 Discount - 208.33 = 500*2500/(2000+1500+2500)

=TotalDiscount * Price / Sum (total Price)

Not applicable
Author

hi

please find attachement.

in script--

LOAD * INLINE [

    sl, item, price

    1, item1, 2000

    2, item2, 1500

    3, item3, 2500

];

then take pivot chart--

               dimension---            sl and item

               expressions---   (1)       only(price) 

                                      (2)      (price*500)/Sum(TOTAL(price))

then output show like this--

slitempricediscount
1item12000166.67
2item21500125.00
3item32500208.33