calculating 12 months Forecast for selected model from the date that report was run on.

Hi ,

 

I need to calculate 12 months forecast from the date report was run on.I want to pass parameters(Itemid, Forecast model id) to get the demand forecast accumulated value. Anyone pls suggest how do I get the value.

Thanks advance 

  • Have a look at \Forms\ForecastSalesBalance\Methods\updatenow
  • In reply to Kranthi:

    thanks kranthi


    Iam using this code but i cant fetch the cumulativeqty.Pls tell me if i done anything wrong in this code.


    public Qty forecastQty(ItemId _itemId,TransDate _date,BudgetModelId _model)
    {
    InventDim inventDim;
    ForecastSales foreCastsales;
    QueryBuildDataSource qbdsfs,qbdsdim;
    QueryRun qr;
    ForecastCreateBalance_Sales bcbalance = new ForecastCreateBalance_Sales();
    Qty qty;


    Query q = new Query();
    qbdsfs = q.addDataSource(tableNum(ForecastSales));
    qbdsfs.addRange(fieldNum(ForecastSales,ProjForecastBudgetType)).value('0');
    qbdsfs.addRange(fieldNum(ForecastSales,ExpandId)).value('0');
    qbdsfs.addRange(fieldNum(ForecastSales,ItemId)).value(_itemId);

    qbdsdim=qbdsfs.addDataSource(tableNum(inventDim));
    qbdsdim.relations(false);
    qbdsdim.addLink(fieldNum(inventDim,InventDimId),fieldNum(ForecastSales,InventDimId));


    bcbalance.sumUp(q,_date,_model);

    qty=bcbalance.totalQty();

    return Qty;


    }

    thanks

  • In reply to LakshmikanthanK:

    Try to debug and see.
    Why are you adding the inventDim to the query?
  • In reply to Kranthi:

    Hi Kranthi,

    while iam debugging the query returns the above-returned query so i manually build that query in my custom method the i send the itemid to that query to filter the  _year,_model in to that method.In that time accqty (accumulateqty) returns wrong value.pls let me know what should i do

    Thanks 

  • In reply to LakshmikanthanK:

    LakshmikanthanK
    In that time accqty (accumulateqty) returns wrong value

    That is what you have to debug and find.

Related
Recommended