Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've got in my module,
the following tables:
Item Table:
Item,
Date
Sales:
Item,
SaleDate,
Qty
I need to calculate for each item sum(Qty) where SaleDate<= Date.
I know set analysis back and forward but somehow i can't manage to do that.
Can someone know how to solve this issue?
Thnx a lot
sum({<SaleDate = {"<= Date"}>} Qty)
let me know if this works for you.
sum({<SaleDate ={ "<= Date"}>} Qty)
See the set analysis used in the tables in the attached file.
Hi,
did you try using an if ?
sum(if( SaleDate<=Date,Qty))
Great & Simple
While the solution works, if statements produce slower results than set analysis.
I dont know if im missing somethign here, but you dont need set analysis. You just need an if statement in the expr =sum(if(SalesDate<=Date,Qty)). Please check the attached.
Yes both solutions will work, but if statements produce slower results than using set analysis. It is optimal to use set analysis over if statements whenever possible
I know set analysis is quicker,
still didn't get right syntax for set analysis that works for that.