NetSuite Invalid Field Value ERROR: Invalid Expression for the following field: custcol_cust_lineshipcost - workflow

I have a custom field that I want to update via workflow - it runs in transaction IF, with 1 State, 2 actions,
Sublist Action Group Items After record Submit Set Field Value Parameters:
Line : Shipping Cost Per Line=NVL({shippingcost},0)/NVL((to_number({line.custcol_item_packagedweight)),0) , Condition: Line : Item Individual Packaged Weight Is Not Empty, Parameters Field Shipping Cost Per Line (Line),
Set Field Value Formula: that has a Visual Builder condition, Line : Item Individual Packaged Weight Is Not Empty, Parameters Field Shipping Cost Per Line (Line), Formula: NVL({shippingcost},0)/NVL((to_number({line.custcol_item_packagedweight)),0)
The field Type is Decimal Number, Store Value, Applies to Item Fulfillment, display applying formatting checked.
Any suggestions on how to fix my error or what I have done wrong?

Related

Group data based on different size

I am trying to make a report in which I need to show data based on Width groups. Below is an example of data & the required output. I'm unable to make a group which can give this required output. If someone can help please.
The easiest way to accomplish your grouping needs for this data set would be to create a new Formula Field that evaluates the values of the Width data field for each record to determine which group the record belongs within, then do the grouping on this new formula field.
You formula field will look like this.
Select {WIDTH}
Case 400 to 600 :
"G1"
Case 601 to 849:
"G2"
Case 850 to 1049:
"G3"
Default :
"Default text or error message text goes here"
You will likely need to adjust the integer values I'm used in the Case statements to evaluate the WIDTH field. The text that goes into the Default case is up to you. In fact, if it works logically with your needs, you could eliminate the Default case entirely, as it is not required. However, it is good practice to ensure the Switch statement always returns a value, even if that value is text to indicate that something unexpected occurred. This allows your users to easily recognize a bit of a data that may be out of range for the grouping of the report so the report can be modified or the data can be corrected, whichever is the most appropriate action.
The other 3 columns in your required output appear to just be counting the number of records within each group that have a diameter within a range. To get this output you can use Running Total Fields with a Type of summary of Count and then use the range of values in the Evaluate section. The Reset section will be set to On change of group evaluating the group created by the formula field above. You will want to put a sort order on the diameter field though.

Output a String that has the categorical value of the final sum seperated out?

Say I have a field [Client] which is either Yes/No
Then I Sum on [NumberOfAccounts]
But on my map I want a string that says "Clients: 23 Prospects: 11 Total: 33"
How do I do that with a calculated field??
Assuming you have one record, i.e. row of data per account, and an account is either a client or prospect depending on the value of the [Client] field. Further recommend you change Client to a Boolean valued field, taking on either True or False, instead of using a string, and finally assuming you rename the field [Client?]
Give all that, you define a calculated field called [Clients] as
INT([Client?])
And then you can put SUM([Clients]) on the Text/Label shelf to get the number of clients.
Likewise, you can define a calculated field called [Prospects] as
INT(NOT [Client?])
And also put SUM([Prospects]) on the Text/Label shelf.
This works because the type conversion function INT() converts True to 1 and False to 0. Then the SUM() function effectively counts the number of records that satisfy the Boolean condition.
Finally, also add SUM([Number of Records]) to Text/Label.
Once the measures are included in text or label, you can edit the label text by clicking on the Text/Label button on the marks card to add the surrounding strings.
BTW, The button is called either Text or Label depending on your choice of mark type.

Add filter/parameter in calculated field tableau

I'm trying to create calculated field in tableau, my below query is showing valid, however I want to give filter or parameter to it. For ex: I have a field called Account number and I want my below query to show sum of all the quarters revenue on account number level.
Sum(If ([Qtr]='2019-Q1' OR [Qtr]='2019-Q2' OR [Qtr]='2019-Q3' OR [Qtr]='2019-Q4')
THEN FLOAT([Revenue]) END)
Your logic will work.
For parameter: Create a parameter with String data type, add all field names to it. Then create a calculated field based on the parameter list. Add that calculated field to row shelf then change Parameter, the above formula will be recalculated.
For Filter: You can add filter directly.
1st option:
Add Account number as row in your worksheet
Create a Parameter String with values: 2019-Q1, 2019-Q2, 2019-Q3, 2019-Q4
Update your calculated field to:
If [Qtr]='Parameter Value' THEN FLOAT([Revenue]) END
Add this field as text and the value of sum will be for only that Qtr period
2nd option:
Add Account number as row in your worksheet
Create a Parameter String with values: 2019-Q1, 2019-Q2, 2019-Q3, 2019-Q4
Update your calculated field to:
[Qtr]='Parameter Value'
Add this field to the filters and the whole worksheet will filter on that Qtr period
You can also add another parameter for the year to be more flexible on the years

Fix the "Cannot mix aggregate and non-aggregate arguments with this function" error when creating a calculated field

I need to create a Dimension (calculated field) that depends on a filter.
My dataset has four columns: ID (Int), Variable Name (String), Value (Int) and Client ID (String). For each client ID there will be a value for each type of variable.
There are 6 types of Variable Name, and for each row there is unique ID.
I'm using a filter by Variable Name so there is one, and only one variable type available at the same time.
In order to display it in a stacked bar chart by that dimension, I have created this calculation field (In reality if has six IFs, but I'll use just one to illustrated it):
IF ATTR([1 (ML_Output)].[Variable Name])= "Interest Rate" THEN [Interest Rate] END
That way, when the filter is in "Monthly Interest Rate", the ATTR function should show the only type of variable available in the Variable Name field, which would be "Monthly Interest Rate". The problem is that it shows the "Cannot mix aggregate and non-aggregate arguments with this function" error.
I've been trying to solve this with many tutorials, but none of them work for one reason of another.
Any ideas?
EDIT:
PS: The original calculation that was doing what I wanted used a Parameter. However, since parameters won't update automatically when the dataset changes, I can't use it anymore. The original calculation was:
IF [Parameter 1]="Interest Rate" THEN [Interest Rate] END
I need the calculated field as a dimension. So, if I aggregated the result of the calculation, then it would be a measure, and that can't be used to create a stacked bar.

ssrs sum function in textbox

I have 2 datasets in my report. And I need to put a number of rows that meet a certain condition in a text box.
Here's what I have so far:
=Sum(IIF((Fields!OPEN_TIME.Value, "calls")=Parameters!Date.Value,1,0))
I get following error while running the report:
The Value expression for the text bix uses an aggregate expression without a scope. A scope is required for all aggregate used outside of a data region unless the report contains exactly one dataset
What do I miss?
Here if you are specifying a dataset name to a field like this "(Fields!OPEN_TIME.Value,"calls")" its a syntax error.. if you are using the field in a table which is assigned to dataset1 and table is assigned to dataset2 or field in a text box, then the field should be used with aggregate or "First", "Last"
Example:
first(Fields!OPEN_TIME.Value, "calls")
last(Fields!OPEN_TIME.Value, "calls")
sum(Fields!OPEN_TIME.Value, "calls")
Count(Fields!OPEN_TIME.Value, "calls") ...etc
In above scenario rather than taking a textbox, take a table with single cell assign the dataset "calls" to it then go for below expression:
=Sum(IIf(Fields!OPEN_TIME.Value = Parameters!Date.Value, 1,0))