This is my little black book for diy-software
This is my little black book for diy-software
Sales System Design - mail Slots 617 view
DIY1 Library Code Samples view folder
Check these to make sure they are all the same...
DIY1 Brics DIY1_bc DIY1_PE DIY1_ZAS DIY1_KC
https://diy1.brics-practice-management.com
https://diy1-script-library.brics-practice-management.com
publishing.brics-practice-management.com view
GSheets Filter
Searching Data Tables and returning filtered subsets of data is key in all database management systems.
For sets of data with 100's or 1000's of records simple searches for one field or a combination of fields with an AND connector is easy.
= filter ({ }, condition1, condition 2)
=filter({Contacts!$A:$A, Contacts!$B:$B,Contacts!$C:$C},Contacts!$D:$D = B8) --> wher B8 is a select box for D data...
=if(B8="","", ifna(filter({Contacts!$A:$A, Contacts!$B:$B,Contacts!$C:$C},Contacts!$D:$D = B8),"No records")) --> with data validation
Doing searches for 10,000's or more and OR conditions is NOT easy. The select box/drop downs start to seize up and the ORs require custom programming. There is a "query" function that uses SQL HOWEVER, it requires reference to columns by letter and if the table columns move it breaks. Those references are absolute not reltaive as the sql strings are static text. The column refs in traditional spreadsheets are relative refs not absolute. Thus, the "query" fxn is NOT a viable solution for most use cases unless the table format will never change. and that is not ideal for customizable software. Luckily with a little help from youtube and the use of "composite index columns we create we can do many things.
Use Filter with Search Function for wildcard match
https://www.youtube.com/watch?v=s4bjzX_NQC4
For one criteria per field on only...
= filter (range, search( value, sub-range), search(value,sub-range) )
For two criteria per single field may be able to use OR with filter OR use regex...
= filter (range, regExmatch(subrange, "value1 | value2")
OR if you can make a composite key where multiple fields are concatenated in a single field for search, you can do this...
= filter(range, search( value, sub-range that is concatenated values )
=if(B8="","--", ifna(filter({Contacts!$A:$A, Contacts!$B:$B,Contacts!$C:$C},Search(B8,Contacts!$X:$X)),"No records"))
and if using the red row techniques with padded row, it looks like this...
=
{
ARRAY_CONSTRAIN(arrBlanks,1,3);
if(B7="",{"--","",""},ifna(filter({Contacts!$A:$A, Contacts!$B:$B,Contacts!$C:$C},Search(B7,Contacts!$X:$X)),{"No Match...","",""}))
}
=sort ( filter ( SO_headers_tbl!AB13:AB , SO_headers_tbl!T13:T = "ar_open" ), 1 , true )
Array formual for multipl ifs only works iwth IF, not with IFS or SWITCH, this is cleanest syntax. .
=Arrayformula(
If(J10:J="","",
if(J10:J="USPS", hyperlink("https://tools.usps.com/go/TrackConfirmAction.action?tLabels=" & K10:K, "View on USPS"),
if(J10:J="UPS", hyperlink("https://ups.com=" & K10:K, "View on UPS"),
))))
NOTE: the trailing comma on the last line is proper and fine, it suggest there is no follownig else and sets you up to add more lines without forgetting teh comma.
Multiple Filters stacked for Payment and Shipment Details
={
"","";
"Pmt ID","Details";
filter({Payment_Journal!T4:T,Payment_Journal!U4:U},Payment_Journal!D4:D=D4);
"ShipID","Details";
filter({Shipping_Journal!V10:V,Shipping_Journal!W10:W},Shipping_Journal!D10:D=D4)
}
Bill to vs Ship to as priority keys...
https://www.reddit.com/r/salesforce/comments/m8ot8d/data_integration_accounts_by_bill_to_or_ship_t0/
See
Get first item from Google sheets Split
https://stackoverflow.com/questions/32307788/get-first-item-from-split
=index(SPLIT("1.23/1.15", "/"), 0, 2)
for arrayformula...
=query(SPLIT("1.23/1.15", "/"), "SELECT Col1") or it says this...
=query(SPLIT("1.23/1.15", "/"), "SELECT Col1 label Col1 '' ")
or it says this...
=ARRAYFORMULA(IF(A1:A="","", FILTER(SPLIT(A1:A,"/"),{1,0})))
use a cell refernce to get 3rd item from a multi line cell entry and then parst the items in that with regEx to break apart to quickly copy and paste into city state zip columns
G10 - enter cell ref
H10 =index(split(Indirect(G10),char(10)),0,3)
H11 - =regexExtract(H10,"(.+),")
I11 =regexExtract(H10,", (.+) ")
J 11 =regexExtract(H10," (\d+)")
----------------------------
G10 - just enter row #
H10 =index(split(Indirect("e" & G14),char(10)),0,3)
H11-J11 the same
-------------
G10 - enter SO #
H10 =index(split( vlookup(N14,{A19:A,E19:E},2,0),char(10)),0,3)
H11-J11 the same
Same thing but different...
1) enter so ID
------------------
2a) Street
=index(split( vlookup(J4,{A18:A,E18:E},2,0),char(10)),0,2) OR...
=REGEXEXTRACT( vlookup(J4,{A18:A,E18:E},2,0),"\n(.+)\n")
2b) City
=Regexextract(index(split( vlookup(J4,{A18:A,E18:E},2,0),char(10)),0,3),"(.+),")
2c) Zip
=Regexextract(index(split( vlookup(J4,{A18:A,E18:E},2,0),char(10)),0,3)," (\d+)")
-----------------------
3) run the script
4) parse the values from the response string in cell above...
=REGEXEXTRACT(K8,"""rate"":(.+?),")
=REGEXEXTRACT(K8,"""jurisdiction"":""(.+?)"",")
=REGEXEXTRACT(K8,"""county"":""(.+?)"",")
5) ctrl-c , ctrl-shift-v into row