Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rohitians
Creator III
Creator III

Inventory Calculation expression.

Hello,

SUM(AGGR(if(date(vSelectDate)-max({$<[Inv Flag]={1}>}[Posting Date])>=181 ,

((SUM({$<FinancialYear=,Quarter=,MonthName=,FiscalYear={$(=max(FiscalYear))},[Posting Date] ={"<=$(=MonthEnd(Max([Posting Date])))>=01/04/2012"},[Inv Flag]={0,1,3,5}>}QTY_SIGNED) /* Closing Qty of prev month*/

-

SUM({$<FinancialYear=,Quarter=,MonthName=,FiscalYear={$(=max(FiscalYear))},[Posting Date] ={"<=$(=MonthEnd(Max([Posting Date])))>=01/04/2012"}>}[Sales Invoice Qty]) /*sales Qty from 1/4/12 till date*/

-

SUM({$<FinancialYear=,Quarter=,MonthName=,[Posting Date] ={"<=$(=MonthEnd(Max([Posting Date])))>=01/04/2012"}>}[Sales Bonus Qty]) /*sales Bon Qty from 1/4/12 till date*/

+

SUM({$<FinancialYear=,Quarter=,MonthName=,[Posting Date] ={"<=$(=MonthEnd(Max([Posting Date])))>=01/04/2012"},[Sales Return Type Code]={0}>}[Sales Return Qty]) /*sales Ret Qty from 1/4/12 till date*/

+

SUM({$<FinancialYear=,Quarter=,MonthName=,[Posting Date] ={"<=$(=MonthEnd(Max([Posting Date])))>=01/04/2012"},[Sales Return Type Code]={0}>}[Sales Return Bonus Qty]) /*sales Ret Bon Qty from 1/4/12 till date*/

)

*avg([Stat Rate Inv]))/100000),[Product Batch Code],[Location Code],[Product Code],[Expiry Date]))

The above is the excisting expression where i get inventory from 1-4-2012 ,

now i am intoducing financial year , suppose i select 2013-2014 it should only show this years inventory rather then from 1-4-2012  where do i change this expression...

Thanks and Regards,

Rohit Yadav

1 Solution

Accepted Solutions
Jason_Michaelides
Partner - Master II
Partner - Master II

Wow.  I would seriously look at reworking your data model to allow a simpler calculation!  Can help with that if you like - please post the data model and some sample data.

Jason

View solution in original post

2 Replies
Jason_Michaelides
Partner - Master II
Partner - Master II

Wow.  I would seriously look at reworking your data model to allow a simpler calculation!  Can help with that if you like - please post the data model and some sample data.

Jason

rohitians
Creator III
Creator III
Author

hello,

Yes the logic has to be changed i have realised that but i am not allowed to share any info in my company sorry..        thanks for your reply.....If possible would mail u my logic if give ur email id..

Thanks and Regards

Rohit Yadav