Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I need to compute Stock Amount on hand .
To make thing simple , for Jan 2012 till Jan 2013 , on the first of the month i add Qty 2 , and on 17 of the month i take out Qty 1.
So every month i have Stock Balance Qty 1 , because 2-1=1 . And at the end of 13 month , my stock balance = 13.
I need expression to display Stock balance as below behavious :-
when user select on month=1 year = 2012 , i need the stock balance display 1.
when user select on month=2 year = 2012 , i need the stock balance display 2.
when user select on month=3 year = 2012 , i need the stock balance display 3.
when user select on month=4 year = 2012 , i need the stock balance display 4.
when user select on month=5 year = 2012 , i need the stock balance display 5.
when user select on month=6 year = 2012 , i need the stock balance display 6.
when user select on month=7 year = 2012 , i need the stock balance display 7.
when user select on month=8 year = 2012 , i need the stock balance display 8.
when user select on month=9 year = 2012 , i need the stock balance display 9.
when user select on month=10 year = 2012 , i need the stock balance display 10.
when user select on month=11 year = 2012 , i need the stock balance display 11.
when user select on month=12 year = 2012 , i need the stock balance display 12.
when user select on month=1 year = 2013 , i need the stock balance display 13.
How it will display 13 when i not select month and year.
Paul
Try this.
=Sum({$<date = {"<=$(=Max({$}[date]))"}, month = ,year= >}[Amount])
Regards,
Kaushik Solanki
Try this.
=Sum({$<date = {"<=$(=Max({$}[date]))"}, month = ,year= >}[Amount])
Regards,
Kaushik Solanki
Hi.
See the example. Balance table I added to the script in order to get the result.
Hope this helps.
Regards.
Hi Kaushk
I like your script most , because you give me the result i want. Now i am happy that i am able to implement your script in my actual qv doc. I think it sure work fine.
Paul
Hi Kaushik
http://community.qlik.com/message/335321#335321
I start a new post , because you already solve my problem using the sample QV doc. Now when i apply your script in my expression it work fine , but i need to get the previous month stock amount , i am not able to do it , can you pls help me.
Paul