Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have a case about calculation based on date valid range. As you can see below, There are Transaction and Validation Table, then I try to get sum(QTY*HARGA) based on date valid range of PRODUCT A, in the final result of sum(QTY*HARGA) must be 540000. But after I did the calculation the result is 1100000. I was confused why the result is not correct, so I make a new table to check in detail, and I saw there are some TGL TRANSAKSI include even not in date valid range (GET_DateFrom).
My question is how take out the TGL TRANSAKSI which is "must not include"? Does anyone have any advice?
I attached the Qvw & data also. Hopefully, it can help.
Have a nice day, Febri.
You can try this also
Sum(If([TGL TRANSAKSI] >= DateFrom and [TGL TRANSAKSI] < DateTo, QTY*HARGA))
Hi,
Try this calculated dimension and expression:
Dimension:=if(len(If([TGL TRANSAKSI] >= DateFrom and [TGL TRANSAKSI] < DateTo , DateFrom))>0,PRODUCT)
Exp:sum( {<[TGL TRANSAKSI]= {">=$(DateFrom) <$(DateTo)"}>} QTY* HARGA)
please check the attached
You can try this also
Sum(If([TGL TRANSAKSI] >= DateFrom and [TGL TRANSAKSI] < DateTo, QTY*HARGA))
@anushree1 Thank you for the advice. unfortunately, when I calculate SUM(QTY) the result is not correct 😕
I guess because you use outer join. It corrects to get SUM(QTY*HARGA) but not for SUM(QTY)
Great @sunny_talwar It works. Thanks a lot