May 17, 200421 yr I'm creating a text field which will generate a text flag via calculation that indicates all of the line items in my portal meet a certain criteria, (ie. "complete" status of related purchase order records from my related purchase orders database). I tried the following calculation but it is generating the text flag if ANY of the items meet the criteria rather than if ALL meet the criteria: Case(PurchaseOrders::POStatus = "Complete", "All outstanding PO's are completed") What can I change in my calculation, or what other approach can I use? Thanks!
May 17, 200421 yr Hi Jana, I think your calculation will actually generate the text flag if the FIRST related record meets the criteria. To achieve your goal you can take (at least) two approaches: - either loop through all related records in the portal and as soon as you find one that does NOT meet the criteria RESET the flag, - or make a calculated field in the related file witha value of 1 (one) if the criteria for that record is met. Then make a calculation (either scripted or a calculation field) in your main file with the following definition: Case(Sum(PurchaseOrders::POStatusFlag) = Count(PurchaseOrders::SomeField), All outstanding PO's are completed") In other words: if the sum of all purchase orders which are completed equals the total of all related records then all outstanding PO's are completed. Hope this helps, Ernst
Create an account or sign in to comment