NetSuite Saved Search That Counts Invoices In An Amount Range - netsuite

I'm trying to create a saved search that groups invoices by amount in buckets of $1,000. Then I would like to count the number of invoices in that range.
What I have tried is creating a grouped text formula with the formula TO_CHAR(ROUND({amount}, -4)) and then another column that is the internal id with the Count summary type. This would work but NetSuite says the formula text column cannot be grouped, presumably because it uses the amount field in the formula.
Does anyone know of an alternate way that I can accomplish this?

If I understand well your needs,
The current formula, group all the transaction from 0 to 4999 together, ...
I have updated it to group all the transaction from 0 to 999, then 1000 to 1999 and so on:
a text formula with the following:
(count/* comment */(ROUND(TRUNC({amount},-3),-3)) OVER(PARTITION BY (ROUND(TRUNC({amount},-3),-3)) ORDER BY (ROUND(TRUNC({amount},-3),-3)))

Related

Please can I get some guidance on techniques using the Unique Function

To clarify, I will attack the code myself, however, it's the order and techniques to do this I need some guidance with.
I have a table with 4 columns. The table has 40000 rows. The columns are Date, Name, location, company.
I want to see how many times someone in the name column, appears in the database. I then want to apply a date filter to that. This I have managed to do if somewhat clunky.
My problem is that the unique function only returns the name, when i apply it to that column. and i need it to return the location and company so that i can sort on that too. How would you go about doing that?
I have used unique on the name column. It returns a spilled over list of about 4000 names. I then
use this code =COUNTIFS(MyName,$A2,MyDate,">="&DATE(List!$D$2,List!M$4,List!M$5),MyDate,"<="&DATE(List!$D$2,List!M$4,List!M$3)) to return the number of entries per month. A2 is the unique return column.
Any guidance would be appreciated.
Allan

Excel Pivot Table - Uneven group interval

I have around about 12,000 individual accounts with balances ranging from .01 to over 5mm. I want to group them in a column header so that I know the number of accounts that fall into each range as well as the summed up value of those accounts. I know how to create my pivot table to do this except for the grouping. I can only get one group to work (0-100,000 and >100,000). What I need is:
0-100,000; 100,000-1,000,000; 1,000,000-5,000,000; 5,000,000+
Can this be done? Manually grouping them isn't very viable given that I have 12,000 different account balances....and I wouldn't really want to do that manually anyway.
Can you add a calculated column to the source of the data with a formula to return the categories you want? A nested "If" statement should handle it with ease. Something along the line of:
=IF(AND(BALANCE>0,BALANCE<100000),"0-100,0000",IF(AND(BALANCE>=100000,BALANCE<1000000),"100,000-1,000,000"))
Just add in the rest of the IF(AND(X,Y),"Display text") to generate your categories.
You could skip the Pivot table entirely and use COUNTIFS
=COUNTIFS(A$1:A$10,">"&0,A$1:A$8,"<="&100000)
=COUNTIFS(A$1:A$10,">"&100000,A$1:A$10,"<="&500000)
And so on
For the last category you can use a COUNTIF
=COUNTIF(A$1:A$10,">"&5000000)
(My formulas assume the data is in Range A1:A10)

DAX Rank by Date

I am Counting on Distinct ID's in a column - this is leading to the sum of the subtotals not equalling the grand total as follows:
What I want to do is rank the Payment Dates in cronological order and select ONLY the highest date to display. In the example above the Grand Total won't change, but the Townville row will not show a Distinct Student Count.
This is a very specific requirement and I'm assuming there's an easy way to do it in DAX - I've tried playing around with both RANKX and MAX but am no closer to solving this.
One last thing - the Rank must be contextual to the Time Filter selected by the user (so if they select 2015 it'd give the second record Rank 1 and the top record wouldn't show. If they select May 2015 it'd give the top record Rank 1 and the second record wouldn't show)
I think this is what you are looking for - I added a calculated column to the PowerPivot model that provides a rank based on the Last Payment Date and the Name of the Student. It will rank the earliest payment for any student as a 1.
The code for the column is as follows:
=RANKX(FILTER(Table1, [Student Name] = EARLIER([Student Name])), [Last Payment Date])
... assuming your table is named "Table1"!
The FILTER is the key that limits the ranking to dates belonging to students with that name only.
Update for Multiple tables
To set up relationships between the tables, go to the "Diagram View" of the model, available in the Home tab of the Power Pivot window.
You can drag fields from one table to the other to create relationships. This will only work if at least one of the fields is unique - it's a good idea to think of the model as a dimensional model, with a tables that acts like a fact and other tables around it that act like dimensions.
From the comment, I would try to get the Payments to act like the fact, and have it link to the Community and Student tables. in this case, you could then have the following code:
=RANKX(FILTER(Table1, Related('Students'[Student Name]) = EARLIER('Students'[Student Name])), [Last Payment Date])
This calculated column would be on your Payments Fact table, and it uses a lookup to a related field.
Note that in this specific case, it would be easier to just run the filter over your Student ID field that is used to lookup the Student name.

Unable to Create a Sub-Total in the POWERPIVOT

I am pretty new with POWERPIVOT tables. I have searched for a bit of time now to resolve my problem but I have been unsuccessful so far. As you can see below, I have created a POWERPIVOT table in Excel 2013 that is composed of two FACT tables, which are based on: 1) a sheet where the clients can insert vote 1 budget entries; and, 2) another sheet where the clients can insert vote 5 budget entries. Also, a few DIMENSION tables have been added to the combination in order to link the Branch names and the expenditure type. Please note that this is only a simple example of what I am trying to produce.
However, my main problem is that I can't add a sub-total that would sum Salary, Operating and Revenues for Vote 1 and Vote 5 separately. What I would like to show is the following:
Please note that I have tried calculated columns and calculated fields at the best of my knowledge but the results are always showing another set of columns for Salary, Operating and Revenues but what I need is just one column that sum the three components so it displays Salary, Operating, Revenues and Sub-Total. Does anyone know how to resolve this problem that I am facing since a long time?
Thanks to gurus.
I would suggest that you start by putting both budgets in the one table and an extra column to designate Vote id., Otherwise I fearyou will need to add a calculated column concatenating the Branch and Expenditure Type in each table, then doing a LOOKUPVALUE from Vote1 on the concatenated column to Vote5 and pull back the value.

Formula in Netsuite Saved Search

I have a problem here. In Column 1 I have count of All he transaction, In column 2 I have Count of transaction of specific status. In column 3 I want the percentage of above 2; like count of specific transaction/Count of total. Is it possible in Netsuite?
Actually there is an interesting feature that makes this possible. Formula fields that have aggregate functions work when the row has an aggregate on it. So for instance if you wanted to see a percentage of orders with status Billed on a Sales Order search you would enter a Formula (Percent) result with a formula like:
sum(case when {status} = 'Billed' then 1 else 0 end) / count({tranid})
and apply an aggregate to that column. The sample uses Maximum but Minimum and Average produce the same result.
I think that isn't possible by just saved search.
You will have to group on search result column status, so, all the count total will be based on statuses and you can't write aggregation based on other search results' columns.
you can further write a suitelet/portlet script to use the saved search result and calculate the stats before presenting on UI.

Resources