Add custom formula to webdatarocks - webdatarocks

Is it possible with webdatarocks to calculate % of difference per row for each period?
I want to add 3rd column and get % od difference for "Sum of foodDonorDelta" so for 30/09/2020 it will be null, for 31/10/2020 it will be 4000%, for 30/11/2020 it will be -78% and for 31/12/2020 it will be 1000%.
I Know I can set "% Difference" in fields options
but then I have to move "Values" to "Rows" while I need them in "Columns"

The %difference aggregation function of WebDataRocks has the following logic:
If the Values are in Rows, the %difference will be calculated based on the Sum row. In case Values are in Columns, the %difference will be calculated based on the Sum column.
So it is possible to calculate the %difference between Sum values per row, but only when the Values are in Rows.

Related

NetSuite saved search formula to multiply results of two other columns

I currently have a saved search that populates a list of items.
My current results are standard NetSuite fields which are "Name", "Description", "Type", "Average Cost" & "Available"
I am trying to add another column for a formula that multiplies the Average Cost by the Available to give me the Value of the Available SOH.
In your saved search results add a new field of type formula(numeric). In the formula popup window use this formula:
NVL({averagecost}, 0) * NVL({quantityavailable}, 0)
This will multiply the average cost and quantity available together and give you the result. I put the NVL in there in case an item doesn't have an average cost or quantity available you won't get an error.

PowerPivot DAX Max of two values

I have two columns and I need to extract the maximum value of those two for every row in my table. I have looked at the Max, Maxx and Maxa, but they all have input for just one column.
How would I write following expression in a Calculated column:
=max(
Table1[Column1],
Table1[Column2]
)
Actually, you should write the formula exactly as you described:
=max(
Table1[Column1],
Table1[Column2]
)
MAX function in dax exists in 2 versions: one takes a single column, the other takes 2 singular expressions.
Instead of MAX, you can just use a simple IF to achieve what you want:
= IF(Table1[Column1] >= Table1[Column2], Table1[Column1], Table1[Column2])

Displaying Max, Min, Avg across bar chart Tableau

I have a bar chart with X axis as discrete date value and Y axis as number of records.
eg: x axis (Filtered Date)- 1st Oct, 2nd Oct, 3rd Oct etc
y axis (Number of Records)- 30, 4, 3 etc
Now, I have to create a table to get Max, Min and Avg. Value of the 'Number of Record'.
I have written a Calculated Field as MAX([Number of Records]) to get the maximum of Number of Records in this case 30 but I always get a value of 1.
How do I define the values to get max, min and avg. ?
Thanks,
Number of Records is an automatically calculated field that tableau generates when importing a datasource. You can right click on it and see the definition of the calculation: 1.
As you currently have your field defined, tableau will look for the maximum value of the column. It will always be 1 because that is the only value in that field for every record.
It sounds like you are actually trying to calculate the maxiuum of the sum of the number of records for your aggregation level (in your case date). You should be able to easily accomplish this using Level of Detail (LOD) expressions, or table calculations. Something like the following:
WINDOW_MAX(SUM([Number of Records]))

how to put a filter on magento collection on a computed column value

How to add filter to collection to a computed column?
$collection->getSelect()->columns("sum(col1,col2) as distance ");
distance is computed from addition of col1 and col2
now how to place a check on distance<10 and reduce the number of items in the collection.
->addFieldToFilter('distance',array('gt'=>10)) didn't work
I have replaced a complex mathematical function with sum for simplicity
you can simply use having clause $collection->getSelect()->having('distance >10') directly in your query
take a look at this question https://magento.stackexchange.com/questions/6305/how-to-add-dynamic-field-in-magento-collection

Sum Formula Crystal Reports Inquiry

Ok, say I have a subreport that populates a chart I have from data in a table. I have a summary sum field that adds up the total of each row displayed. I am about to add two new rows that need to be displayed but not totaled up in the sum. There is a field in the table that has a number from 1-7 in it. If I added these new fields into the database, I would assign a negative number to this like -1 and -2 to differentiate it between the other records. How can I set up a formula so that it will sum up all of the amount fields except for the records that have an 'order' number we will call it of either -1 or -2? Thanks!
Use a Running Total Field and set the evaluate formula to something like {new_field} >= 0. So it will only sum the value when it passes that test.
The way to accomplish this without a running total is with a formula like this:
if {OrderNum} >= 0 Then {Amount}

Resources