Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Hareeshkommineni
Contributor III
Contributor III

i have two tables one table has original price another table has discount how to get after discount

Start Date End Date Product %Discount
09-01-19 12-01-19 A 20
08-01-19 11-01-19 B 10
06-01-19 10-01-19 C 30
05-01-19 09-01-19 D 10
06-01-19 08-01-19 E 20
05-01-19 07-01-19 F 30
04-01-19 06-01-19 G 50
02-01-19 06-01-19 H 40
Date Product Cost
11-01-19 A 1000
10-01-19 B 2000
09-01-19 C 3000
08-01-19 D 3000
07-01-19 E 4000
06-01-19 F 5000
05-01-19 G 1000
04-01-19 H 2000

i want after discount price

6 Replies
miguelbraga
Partner - Specialist III
Partner - Specialist III

Hi there,

 

Maybe what you want is something like this:

=Sum(Cost) * (1-Sum(%Discount)/100)

 Screenshot_2.png

Have this example attached

 

Best Regards,

MB

Hareeshkommineni
Contributor III
Contributor III
Author

Thank you...

miguelbraga
Partner - Specialist III
Partner - Specialist III

If this helped you mark as answered so the thread is closed. Have a nice day.

mdmukramali
Specialist III
Specialist III

Hi,

as per my assumption based on the dates, I think the discount is going to change.

so you have to use the Interval match concept to check the Discount for the period.

sample Script:

 

Discount:
LOAD * INLINE [
Start Date, End Date, Product, %Discount
09-01-19, 12-01-19, A, 20
08-01-19, 11-01-19, B, 10
06-01-19, 10-01-19, C, 30
05-01-19, 09-01-19, D, 10
06-01-19, 08-01-19, E, 20
05-01-19, 07-01-19, F, 30
04-01-19, 06-01-19, G, 50
02-01-19, 06-01-19, H, 40
];

Costs:
LOAD * INLINE [
Date, Product, Cost
11-01-19, A, 1000
10-01-19, B, 2000
09-01-19, C, 3000
08-01-19, D, 3000
07-01-19, E, 4000
06-01-19, F, 5000
05-01-19, G, 1000
04-01-19, H, 2000
];

Inner Join
IntervalMatch ( Date, Product )
LOAD [Start Date], [End Date], Product
Resident Discount;

 

 

Thanks,

Mohammed Mukram

 

 

Hareeshkommineni
Contributor III
Contributor III
Author

tq this more usefull for me 

sagarwal16
Partner - Contributor II
Partner - Contributor II

How to get after discount values using interval match