Discussion board where members can get started with QlikView.
Hi, I need help in arriving at the contribution value below.
I am calculating Avg Sales for a customer = Total Net Sales / # of months ( the number of months changes depending on what date range the user selects)
This Avg Sales is to be compared with a range of values to get the contribution. Each customer has his own range of values.
For example, if Avg Sales = $9,822.30 then contribution should be 0.03
From To Contribution
$0.00 $6,680.00 0.00
$6,681.00 $8,040.00 0.01
$8,041.00 $9,470.00 0.02
$9,471.00 $11,040.00 0.03
$11,041.00 $0.00 0.04
You can do this with an if() function.
if([AvgSales] >= 11041, .04
,if([Avg Sales] >= 9471, .03
The Total AvgSales, From and To values change based on Customter selected.
I used if('$(vAvgSales)'> From OR '$(vAvgSales)'< To, Contribution) but does not work.
Since 8435.73 falls in From/to value range 0.00 - 10,750.00 I expect contribution field
to be filled up with 0.01 for this customer14331600
I'm having trouble understanding. Can you post an example QVW?