Acumatica Formula for Dividing 2 values - acumatica

I am trying to divide values and display it in a new custom field(usrQuantity)on Stock Items Screen.
I want to divide OpenQty (which is a column in POLine) and CARTONQTY(which is not a column name but just an attribute in column AttributeID in CSAnswers table).
enter image description here
I am confused how to perform this division since CARTONQTY is not a field, I noticed that there is a field named CARTONQTY_Attributes in InventoryItem table which has been generated by some Join queries but is not actually present in the Database(checked in SQL Management Studio).
enter image description here
I tried this formula in the DAC of usrQuantity
[PXDBInt]
[PXUIField(DisplayName="Quantity")]
[PXFormula(typeof(Div<POLine.orderQty,InventoryItem.CARTONQTY_Attributes>))]
But it is giving following errors
The type or namespace name 'POLine' could not be found (are you missing a using directive or an assembly reference?)
The type name 'CARTONQTY_Attributes' does not exist in the type 'PX.Objects.IN.InventoryItem'

Do you want to store the value in the db? Typically it's not recommended practice to persist calculated values unless, for example, there's a performance issue in performing the calculation on the fly. If you don't want to store it, you probably want a PXInt instead of PXDBInt. Also, unless you always expect a whole number as a result of your division (which is unlikely), you should probably use a PXDecimal type.
To then get your calculated value into your new field, I would probably set it in RowSelecting and RowUpdated event handlers by extending the appropriate PXGraph class; in order to calculate it as you retrieve a row and when you update the row values.

Related

ADF Mapping Data Flow - Dirty / Label Replacement / Sink cache and derived column

I am trying to build a ADF mapping data flow for generic adding Label - it's purpose is to see a value in a particular column and replace it with a label . I already have my dataset that looks like this (Table B):
enter image description here
The goal is to replace the values with the label ones. Since my label dataset mapping file is in a Cached Sink (Table B),I thought that I could use a Derived Column Activity, along with Cached Lookups to find the clean value, given the current Column Name and current value (dirty) as keys. I did a rule-based mapping expression to get just the columns that needed cleaning:
enter image description here
I tested the derived column transformation using: Each column that matches:libCached#lookup(name).Column_Name
enter image description here
This part allow me to distinct column names that need to be replaced by label and that's working fine.
I need help to make the replacement I tried several formulas it still doesn't work, I don't know if it's achievable or not ??
thanks a lot
To replace the actual values in the derived column, you'll need to use the lookup formula using the key that you've set in the cached sink so that ADF can match on that value. In the screenshot you have, it only shows that you checking for null and are not actually returning the lookup value.

Spotfire How column reranks when data is limited by expression or filtered?

I have a shapefile in Spotfire and in the tableview of it I have a column displaying DenseRank. For example, if limit data by expression from the full 100 rows in the table to just 30, the DenseRank does not change. How can I perform this task?
Thanks,
Chris
Tableview does not allow dynamic calculations, unless you have a Document Property in the expression, The calculated column expression executes whenever Document Property value chane (or Calculations refreshed), for your scenario I think instead of using filter create a property control with Fixed values (10,20,30...100) or Values from a column (the one you are using to filter data). and use Document Property linked to the Property Control in your Calculated Column Expression .....
I found a workaround to dynamically rank data based on filtering or marking. If you create a data function as simple as "tableout <- tablein" then you can pass the original filtered and/or marked table to a new table. From there, insert calculated column on the new table and it will recalculate each time.

Dynamic validation list in Excel

I have an issue regarding data validation in Excel, namely how to dynamically set the validation source.
I have three tables, where the first contains a product ID and a product name. The second table contains a product ID together with a serial number. A third table has three columns; one for product ID, one for serial number and a description for e.g. error reporting.
What I want to do is related to the third column where I select the product ID in a drop-down box which is linked to the first table. This works perfectly fine. The second column though, must only allow serial numbers related to the product ID selected according to the relationship in the second table. Hence, the data validation list must be dynamically generated by the input in the first column.
The reason for having it in Excel is due corporate reasons and personally I'd use an SQL-database for this very issue. E.g. if I were to use SQL-syntax to generate the validation list, the corresponding SQL-statement would be:
SELECT serialNumber WHERE productId = 12345;
I've tried using the INDEX-MATCH, but unfortunately MATCH only returns a scalar value rather than an array. I have not come across array functions prior to today, but I assume such might be included in order to accomplish this and have tried a bit without success.
If I somehow were to acquire an array returning the row numbers where there is a match, the INDEX-function would accomplish my needs, I presume.
My question is therefore, is there a method to acquire an array of matched values or can my problem be solved using a more elegant solution? If it could be of value if it can be made without VBA, also for corporate security reasons.
Thanks in advance!

SSAS, dimension numeric value filtering

I am using the multiple dimensional model in SSAS with a seemingly simple requirement.
I have a Product dimension table with a Price attribute. Using Excel pivot-table, I want to filter this Price attribute, for example "greater than $1000". However the filter in the pivot table is a string only, hence I can not do perform any numerical comparison operations, but rather for equivalent strings, e.g. "$1,000.00".
My problem is similar to this thread, and I wonder if there is a solution/work around that I missed?
Best regards,
CT
As suggested in the thread that you link, you could create a measure for the price, and then filter that. The definition of this calculated measure would be something like
[Product].[Product].Properties("Price", TYPED)
assuming the dimension as well as the attribute are named "Product", and the attribute has the price defined as a property named "Price".
(You define a property in BIDS as a relationship from the Product attribute to the Priice attribute.)

SharePoint unique values from lookup

I have a list with a lookup column that is getting "Created" dates from another list, but I only want the unique date values. Is there a way to get this data or to create a calculated column with unique values?
A lookup field actually links to a single item, the display value is more a "human readable" value for the link to the items ID value.
You may also get some mileage from a normal text or even date field and using jQuery and SPServices on the edit and new forms in order to provide changes to the form for the user. This avoids doing a code level customisation for the site that a Custom Field would require.
Not out of the box I dont think. My best bet is to create a Custom Field type that extends lookup with the functionality you are after.

Resources