Netsuite - Saved Search - String All True Results of Case Formula - case

Hoping someone can help me out with a NetSuite question, and I apologize in advance if i’m misusing some lingo.
I am creating a item based saved search and one of my formula (text) result fields can have multiple true values when I apply my case formula. I’m look to combine all the true results of this formula into one comma separated string, instead of a new item row for each true value.
sku contact type
123 John S Owner
123 Jane S Clerk
123 Jack S Clerk
Formula (text) - Custom Label Field Name = Contact Name
Case when {type} = ‘Clerk’ then {contact} end
Currently my results generate a item (sku) row for each case of clerk:
Sku Contact Name
123 Jane S
123 Jack S
I’m looking for my results to be a single string
Sku Contact Name
123 Jane S, Jack S
I know the case function noted above will not string the results by itself; I originally intended to use the group by and max summary types, but I only get one Contact Name result.
Any solutions or work arounds?
Thanks

There are certain grouping functionality available for saved search results, but I don't think what you are trying to do is possible.
If you group your results by Sku, you will get one line per Sku but concenating the contact names from different line results I don't think is possible.

In your SaveSearch's Filter look for mainline and try to set either true(Yes) Or false(No).

There is an undocumented Netsuite function NS_CONCAT() (similar to Oracle's undocumented WM_CONCAT()) that does exactly this. You would group your results by the SKU column, and add formula field with the formula NS_CONCAT({contact}) and the summary type set to Minimum or Maximum.
According to some Netsuite employees on the Netsuite User Group, the LISTAGG function should also work now, and offers more flexibility (if you wanted a delimiter other than a comma for example).

Related

Netsuite Saved Search formula to extract text string

For a Netsuite account, I have noticed the entityid for a customer (the customer ID on the UI) appears as an alphanumeric value using the organisation's customer number format.
However, in a saved search, it appears in the following format,'ACC12345 Parent entity name: ACC67895 Child entity name'. I am trying to use a formula to get the child entity's customer ID number from this text string.
The following formula mostly works in a saved search to extract the child entity's customer ID number (i.e. the 'ACC67895 ' in the above example
SUBSTR({entityid},INSTR({entityid},'ACC',1,2),8)
Is there a way to replace the 8 in this formula with another formula so that it extracts everything from the second 'ACC' onwards until the first blank ' '?
The number of characters of the customer ID varies so I don't want to use 8 as a hard coded value in the formula.
Thanks
I would suggest having your first SUBSTR return everything from the start of the child customer's ID to the end, then nest that inside a second SUBSTR which would use an INSTR to find the space after the ID and cut off everything after that:
SUBSTR(SUBSTR({entityid},INSTR({entityid},'ACC',1,2)),1,INSTR(SUBSTR({entityid},INSTR({entityid},'ACC',1,2)),' '))
Ugly, but it works.

MS Access 2010, Distinct in a Report?

I have a report that is based on a query of diagnoses (for example diabetes). The report returns a list of patients with that diagnosis. The problem is if john Q has diabetes xyz and diabetes 123, so if I run the report to give me a list of everyone with diabetes it will retun his name twice. I really don't want to change the particular query that this based on, I just want distinct name in the report. Is there a way to use distinct for a report or any other way of limiting the names to just once in the report? Or am I going to have to write a distinct query just for this report?
either edit the query by changing SELECT to
SELECT DISTINCT
or set the report to use grouping, you can Group by Name (or more likely, by a patient ID so two people with the same name don't get combined) - it's as described here
if you exclude listing the types of diabetes you will get each person on one line, if you include the types of diabetes you will get each person's details used as a heading with the types of diabetes indented
If the report already exists you can edit it by using the Grouping and Sorting option https://support.office.com/en-za/article/Create-a-grouped-or-summary-report-6a58e9ab-9f74-4689-83b6-c63cddb2c7f9?ui=en-US&rs=en-ZA&ad=ZA#__migbm_0

Participant Name and Attendance in the same row in Google form

I would like to create a Google form which can give me the following sort of response in Excel Sheet.
Student Name 4-Jun
XYZ P
We are using this kind of sheet to mark attendance. All I was able to create from a Google form was
Timestamp XYZ
7/6/2013 6:05:19 Present
Thus instead of having student names as columns, we would like to have them as rows and mark their attendance by dates as columns. Let me know if there is a way to do that.
Thanks.
I don't think the feature is available directly, but once you have the final spreadsheet, you can use the TRANSPOSE function to rotate the results onto a new worksheet. Details are here.

Crystal Report with Multiple Tables - Empty or Cartesian Product

I know this has been asked before..sort of. And that's why I'm posting. Basically I'm building a report in Crystal that relies, to keep this simple, at least 3 tables.
Table A is inner joined to table B by a unique ID. Table B has a child table that may or may not have data related to this unqiue ID.
As a general example table A is a customer table, table B is a product table and the child table is contains the product number. All customers have a product, but not all customers have product number in the child table. I hope I've explained that simply enough.
My issue is sort of between Crytal and Access and how to query this. When I'm writing behind something in VB it's easy enough to write and execute a query and display the result in the desired manner. However I can't seem to get my query straight... I either end up with a report with cartesian product as the resultset, which displays ok...except that even with the few records I have ends up being about 30k pages..or I end up with a blank dataset because the child table does not have corrisponding data to B.
Using outter joins I've managed to get my results within some amount of reason but not acceptable to a real world report. I'm sure this issue has come up but I can't seem to find any suitable answers and to be honest I'm not even sure what questions to ask being a Crystal n00b.
What I'm really after is the data from Table A, the data from Table B and children tables. While they are logically linked and can be linked with the ID field, it isn't necessary I don't think because I am taking a parameter value for the report of the ID field. And once the tables are filtered, no other action needs to be taken except to dump them back on the report.
So can anybody point me in the right direction? Can I set up individual datasoruces (unrelated) based perhaps in a seperate section? Should I build a tree of queries and logic in my DB to get what I need out? I've been racking my brain and can't seem to find the right solution, any and all advice is apreciated and if I can clarify anything or answer any questions I will.
Thanks in advance.
As per requested below:
Section1
ID fname lname
01 john smith
Section2
ID notifiedDate notifiedTime
01 10/10/2012 12:35PM
S2childAdmin
ID noteName
01 jane doe
This data is logically related and can be related in the DB. However it is not necessary as long as the ID parameter is passed to each table. Querying Section1 inner joined with Section2 works fine. But any other arrangements result in more rows than required and I end up with a report many times duplicated. What I really need is something like Section1 joined with Section2 and S2childAdmin as a freely availble table. Otherwise it multiplies my data or results in a null recordset (because it can return 0 rows)
I think this should help point you in the right direction, though it has been 5 years or so since I did heavy Crystal Reports work.
One option might be to join everything using Outer Joins like you stated you were, then use a Crystal Report 'group' on the Table A ID, with a group based upon Table B ID inside of that. So you would, in the actual 'Detail' area put your table C details if there were any, and then use the Group header/footer for Table A and Table B to show data specific to those objects.
Another possible solution that may fall short of your requirements but might get you thinking in another way, is to create your main report and in it, display the fields from table A. Then below those fields include a sub-report and pass in the unique ID from Table A. You will then have a query inside of the subreport that finds all of the Table B records with that Table A.ID value and displays their details.
At this point you run into a weakness of Crystal Reports (at least as of the last version I used) in that you cannot have a subreport inside of a subreport.

Must I loop to search results for a specific value?

I have a table in the database:
name Opinion
Tim Tim has an opinion
John other random text
Dan Dan's random text
Al Al says something else
I call this data and get it back in
getRecords.lastResult
To access John's opinion, I could use:
getRecords.lastResult[1].opinion
But that's only because I know that John is the second record (record 1), but this may change. So the right way is to search through the results to first find the record index for John, then access his opinion.
My guess is I need some sort of a loop? Is there an easier way to search for John directly without a loop?
Well if getRecords returns n records and John has to be on one of them
you can do it in As3 and do a loop around your Arraycollection until you find John.
Or
Do some server logic to return john data given a search string ("john") if unique.

Resources