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

Hi All, I'm new to Qlik and could use some help.

I have pivot table that looks like the one below. I'm trying to take the difference between price and prior price (for same Lot# and plant), if increase in price, then multiply it by quantity sold at price increase. If no increase then 0.  Thank you.

     

Rows Measures
Lot#CustomerPlantMonth Price Quantity SoldImpact
0021Johnnies58 $ 4.35 2                                                                   
0021Johnnies59 $ 5.01 25=if(5.01>4.35 for same Lot# and plant, then Impact =(5.01-4.35) *25
0021Johnnies510 $ 5.10 21
0021Johnnies511 $ 5.10 23
0021Johnnies512 $ 5.25 10
0035Joney78 $ 2.67 6
0035Joney79 $ 2.80 4
0035Joney710 $ 2.85 53
0035Joney711 $ 2.90 5
11 Replies
Not applicable
Author

I just noticed that the formula only works when price changes in same month. If month changes in the next row with a higher price for the same part, it won't calculate.  ??

dwforest
Specialist II
Specialist II

yes, above and Peek, not sure which method you're referring to, by default go back one row in the data. if you have more than one row per month, you'd have to summarize the data at the month level, avg or max or FirstSortedValue using -Date to get last.