Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having weekly product sales.
While using below condition, i am not getting correct results sometimes.
when a new product is added or removed in new week, then it's quantity is getting added to previous week sales (if new product is added) and vice versa.
if([Product Desc] = Previous([Product Desc]) and [Product No] = Previous([Product No]), Previous(Sales),Sales) as Previous_Sales
if previous week sales is 40 and current week sales is 50 with new product having 5 as sales, then using above logic i am getting 45 as previous week sales.
Can any one help in correcting the logic?
did you correct order your datas (so the correct previous line is found)
can you post your script here?
and why do you expect 45. for that the script shoul be
previous(Sales)+Sales
right?
regards
There is no week in your statement, Try to create inline and help us to need output
ok, i'll try for inline script .
But when i put Week condition too, then current sales and previous sales are becoming equal
I am expecting 40 but it is coming 45 due to Previous(Sales) +Sales of new product(which is not present in previous week)
Let's Consider with example
Product Desc, Product No, Sales
12, 10, 100
12, 10, 200
13, 20, 200
10, 30, 200
13, 20, 300
And, If you apply your condition. Outcome will be this
Product Desc, Product No, Sales, Product_Sales
12, 10, 100, 100
12, 10, 200, 100
13, 20, 200, 200
10, 30, 200, 200
13, 20, 300, 300
Does it make sense?