AnsweredAssumed Answered

Unstored Calculation will not hold result of calculation

Question asked by DominiqueHawinkels on Apr 22, 2016
Latest reply on Apr 23, 2016 by erolst

My Problem

I am trying to count the number of pallets of product, used over a period of time, and am having trouble getting an unstored calculation to displaying the correct value.

It constantly shows the count for all the pallets, not just the ones related to the product. )

When I test the calculation in the Data Viewer, it works fine.  However, when I attach it to a field as an unstored calculation it fails to work.

Help understanding and solving the issue would be appreciated.

 

Supporting Material

The following  are the fields and relationships (TOCs) that I use.

 

Fields - Product Table

  • StockAtStart (Number)  In which I can enter a value for beginning of Period
  • StockReceived (Number) which holds the amount of new stock added during period
  • StockUsed (Unstored Calculation) Count of stock units
  • StockInStock (Unstored Calculation) Count of StockAtStart + StockRecieved - StockUsed
  • PeriodStartDate (Date) In which I can enter a start date

PeriodEndDate (Date field) In which I can enter a finish date

 

Fields - Pallet Table

 

- Date (Date:- Date pallet used)

- Product ID (Number:- ID of product stored on pallet)

 

Calculation for StockUsed field.

 

Case (

       Product::Period | Start = "" ;

         Case (

                Product::Period | End = "" ;

                  "" ;                                                                              // No date range

                  Count ( ProductsUptoPeriod::__ID )                         // End date only

                           ) ;

         Case (

                Product::Period | End = "" ;

                  Count ( ProductsFromPeriod::__ID ) ;                       // Start date only

                  Count ( ProductsForPeriod::__ID )                          // Date range

              )

     )

 

 

Relationship TOCs

Product TOCOperatorProductsUptoPeriod  TOC
__ID=__|D   | Product
Period | EndDate

 

Product TOCOperatorProductsFromPeriod
__ID= __|D   | Product
Period | EndDate

 

Header 1Header 2Header 3
__ID=
Period | StartDate
Period | EndDate

Outcomes