Query conditional unique cases for Google Sheet Mailing List - filter

For maintaining a research project I'm setting up a Google Sheet to create mailing lists using logical operators.
The basic structure is a "contacts" sheet with an ever-growing list of email addresses, names, etc. I then add a new sheet for each new email-campaign (i.e., a mass email to be sent out). There is also an "unsubscribe" list to suppress email address inclusion in any future campaigns.
I struggle to come up with a solution that allows me to identify email addresses that have been e.g.,
(a) never contacted as yet
(b) twice contacted already
(c) not contacted through "campaign1"
AND are not part of "unsubscribe"
My logical approach has been to establish a "history" sheet that lists all email addresses of any campaigns so far. I'm challenged to find a solution that compares "contacts" and "history" and correctly returns the rows that align with my search parameters, yet returns a given email address no more than once (so as to not email people multiple times per campaign).
I've tried to various configurations and nesting of QUERY, FILTER, SORTN including UNIQUE to establish a universal approach that uses "contacts" as a central source from which to logically extract rows as illustrated above.
This sheet reflects the above (no functions) and invites for suggestions: https://docs.google.com/spreadsheets/d/1NRY-udwepbFahVryX7FF6WIQ0vtFJkjuuhRWFJVAWnI

1. never contacted as yet
=FILTER(contacts!A2:D1000, NOT(COUNTIF(contacts!B2:B1000, history!B2:B1000)))
2. twice contacted already
=UNIQUE(FILTER(history!A2:D1000, COUNTIF(history!B2:B1000, history!B2:B1000)>1))
3. not contacted through "campaign1"
=FILTER(campaign2!A2:D1000, NOT(COUNTIF(campaign1!B2:B1000, campaign2!B2:B1000)))
4. are not part of "unsubscribe"
=FILTER(contacts!A2:D1000, NOT(COUNTIF(unsubscribe!A1:A999, contacts!B2:B1000)))
5. twice contacted already AND are not part of "unsubscribe"
=UNIQUE(FILTER(history!A2:D1000, COUNTIF(history!B2:B1000, history!B2:B1000)>1,
NOT(COUNTIF(unsubscribe!A1:A999, history!B2:B1000))))
6. define the formulas using named ranges.
=UNIQUE(FILTER(History, COUNTIF(historyB, historyB)>1,
NOT(COUNTIF(unsubscribe, historyB))))

Related

Why is this considered stateless?

Been discussing architecture of a new service with a co-worker today and there's a concept I'm having some issues wrapping my head around.
Two question really, first one being whether or not the image example used at https://ruben.verborgh.org/blog/2012/08/24/rest-wheres-my-state/ is still be considered stateful, if we introduce two changes:
GET /nextImage?userId // Does NOT update the value of current image
// Updating current image requires setting it explicitly:
PUT /currentImage?value=X // X being the image number
If the answer is "No" it might make a bit more sense to me, but let's continue.
The service we are discussing is a word prediction service which has an added functionality of "user dictionary words" - it can predict not only words from a static dictionary in the service, but also words supplied by the user.
My suggestion to make the service stateless:
GET /predictions?userId=X&text=Y&words=Z
text being the text the user wrote, words being the list of "user dictionary words" and the response being a list of words that fit with the text parameter (including those from words).
My co-worker's suggestion:
Rather than sending words in each request, put them in a database (identified by the user ID and manipulated via separate RESTful API) and just send the request:
GET /predictions?userId=X&text=Y
Supposedly this is also stateless, but I'm not quite sure why - isn't this list of words in the database equivalent to storing the value of currentImage and thus stateful?

Has anything changed on geocode API

I just wanted to know if anything changed on geocode API from 21 st February because before 21st it was validating zip code 9 digits but from yesterday it is giving an error on 9 digits zip code and now it only validating 5 digits zip code.
More information in your question would be helpful.
I haven't noticed any change, but I thought I'd take a look at the GeoCoder Documentation FAQ for you.
Yes, based on that date, I'd say something changed recently.
Perhaps this is what you're referring to, but that's only a speculation since you didn't provide any detail or examples.
Troubleshooting
I’m getting more queries that return ZERO_RESULTS with the new geocoder. What’s going on?
In the new geocoder, ambiguous, incomplete and badly formatted queries, such as misspelled or nonexistent addresses, are prone to produce ZERO_RESULTS. These queries would typically produce incorrect results in the old geocoder, such as returning the suburb if the address could not be found. We believe that returning ZERO_RESULTS is actually a more correct response in such situations.
If your application deals with user input of addresses, the Place Autocomplete feature in the Places API may produce better quality results. Place Autocomplete allows users to select from a set of results based on what they’ve typed, which allows users to choose between similarly named results, and to adjust their query if they misspell an address.
If you have an application dealing with ambiguous or incomplete queries or queries that may contain errors, we recommend you use the Place Autocomplete feature in the Places API rather than the forward geocoder available in the Geocoding API. For more details, see Best Practices When Geocoding Addresses and the Address Geocoding in the Google Maps APIs blog post.
More Information:
Documentation FAQ
Related Issue Tracker

How Facebook generate unique identifiers

I am looking for the way for generating unique identifiers for different business entities in project I am working on. Currently we are using GUIDs, but we want to move to number identifiers. I have worked with Facebook Graph API and figured out they have some kind of unique and self-contained (as I supposed) ids. But I could not find any information or assumptions in the Internet about how they generate this keys.
I formulated some minimum requirments for identifiers based on my suggestions and investigation of Facebook ids. Here they are:
It must be presented as long / Int64 value.
It must be unique in scope of whole system.
It must contains as minimum type of requesting entity (user, page, etc.). So that it gives possibility to create сonvenient API like GET {host}/{id}.
Does anybody have any experience or ideas how can this task can be solved? I guess there should be some existing solutions or specifications for it. If anybody has some suggestions it would be great to hear that.
Ok, the answer for me was Twitter Snowflake. Also you can find some interesting useful information here: Sharding & IDs at Instagram. Hope it helps somebody.

Mailchimp: how to show an article if user has no preferences

Is something like this not possible with a wildcard? I'm trying to send an article to people who do not have any preferences, and if they do have preferences don't show it. I cannot find any documentation on it.
Thanks in advance
*The star means all groups
*|INTERESTED:*|*
//Do nothing
*|ELSE:|*
//Show all
*|END:INTERESTED:|*
No, MailChimp's conditional merge tags don't support wildcards inside of those merge tags.
If the end goal is to show X content to subscribers who have no group affiliations and show Y content to subscribers who have any group affiliations, there are a few ways to accomplish this.
a) You can use *|INTERESTED:GroupTitle:GroupName1,GroupName2,GroupName3|*, etc. to show content to any members of those 3 groups. If you have more than that, of course, just add all of your groups in there with that comma-seperated format. Then, use the *|ELSE:|* as you already are in your example to account for people who aren't tied to any of those groups. This can be tedious though if you have a ton of groups.
b) Consider sending two separate campaigns, each set to send to a segment of your list that targets based on group affiliations (or non-affiliations).
sources:
http://kb.mailchimp.com/article/how-do-i-use-smart-merge-tags-with-groups/
http://kb.mailchimp.com/article/how-can-i-send-to-a-segment-of-my-list/

Google places types to find Xtreme sports

Why the google places types are so limited?, I looking places where to practice extreme sports(i.e. rafting,paragliding,surf) and are not show in the two permitted Lists, and also I can not add this to the lists, somebody could help me?, thanks
You could try performing a Places API Search Request with the keyword parameter instead of types parameter. This is often successful when searching for types of places that are not in the types list.
e.g.
https://maps.googleapis.com/maps/api/place/search/json?key=YOUR_API_KEY_HERE&sensor=false&keyword=paragliding&location=37.3943,-122.151&radius=50000
As per the documentation:
The keyword parameter is matched against all content that Google has
indexed for this Place, including but not limited to name, type, and
address, as well as customer reviews and other third-party content.

Resources