Skip to main content

Goal of the GI:

Compare the Current Price Class with the New Price class, and filter out any entries that are already the same to reduce the amount of entries sent through an Import Scenario

Code for the New Price Class assigns a type of discount based on the amount sold:

=switch(Max([Location.CPriceClassID])='STAFF','STAFF',Sum([SOOrder.CuryOrderTotal])>1200, 'RETAILBULK',Sum([SOOrder.CuryOrderTotal])<1200, 'CUSTOMERS')


But as y’all know, when you make a new field, you can pull up it’s internal ‘field’ name, and I can use that for style like this: =iif(SOOrder_Formulad9d511aff428430595f645b5e7225bcf = 2Location.CPriceClassID],'','red20')

 

But I can’t use it for comparison in any part of conditions or even within the results grid

=rSOOrder_Formulad9d511aff428430595f645b5e7225bcf] doesn’t work

@SOOrder_Formulad9d511aff428430595f645b5e7225bcf of course doesn’t work

just SOOrder_Formulad9d511aff428430595f645b5e7225bcf doesn’t work

Is this a hard limitation on GI’s, or is there a trick I don’t know?

If it is a hard limitation, what resources should I point myself towards for doing it on the SQL end? I’ve never customized ACU before.

Bumping this in case that helps.


@lunarchickadee Is the need to filter an import scenario based on a GI?

If so, you can try this approach:

Add a column in the GI named something like “Import criteria”. The formula should be something like =IIF( New Price <> OLD Price, 1,0)

Then in the import scenario, add a condition to only import where this column = 1


That’s pretty much what I ended up doing. Since the import scenario took all the values as their own strings/values after being exported.

Question still stands though. Is there a way to, within a GI, reference a field that’s a calculation?


The order GIs are processed in means a calculated field doesn’t yet exist to be referenced in the Condition tab.  One would need to extend the DAC or inject SQL to have it available for use in Condition.  Nor can one reference a previous calculation in a lower row on the Results Grid.

You can reference it in the Navigation tab for use in a Parameter, which is interesting.

 

 

That said, you can stuff a formula into Value1 for any random datafield.

 

Example: a terrible way to filter items where the unit price is >2

SOOrder.Approved Equals  =iif(lSOShipLine.UnitPrice]>2,iSOOrder.Approved], Not vSOOrder.Approved])

 

Unfortunately the Condition tab happens before Grouping, so your example of summed order totals wouldn’t work.

If you had another DAC that gave you a customer’s order totals, then you could filter it easily by comparing the results of the Iif to the current class using Not Equals

 

 


Reply