Mailchimp Conditional Merge tags using a date field not working - merge

This is not about the API. This is about using Mailchimp and setting conditional merge fields in the backend of Mailchimp when building a campaign. So this question is about how Mailchimp works rather than about integrating Mailchimp via an API or something similar.
(You're still here? Great! :-)
I'm trying to use a date field to show conditional content.
I have 3 people in my test mailing list, one with birthday 1/1/1960, one with 1/1/1970 and one with 1/1/1980.
I've set up an email with three conditional block so that each recipient should get the right piece of text in his mail. It looks like this.
The format I'm using is:
*|IF:BIRTHDATE>1/1/1970|*
Some text for people with a birthdate greater than 1 jan 1970
*|END:IF|*
*|IF:BIRTHDATE=1/1/1970|*
Some text for people with a birthdate equal to 1 jan 1970
*|END:IF|*
*|IF:BIRTHDATE<1/1/1970|*
Some text for people with a birthdate smaller than 1 jan 1970
*|END:IF|*
I've taken the date of the 1st of jan (1/1) to avoid possible conflicts with US and EU date notations to rule that out of the debugging process.
However, eacht recipient receives the last of the three texts when sending the test mailing, meaning that all three, regardless of their birthdate somehow match the last condition *|IF:BIRTHDATE<1/1/1970|*
This is strange since I've deliberately taken the middel birthdate to rule this out.
The date notation in the list of recipients matches the exact dat notation that I'm using in the conditions.
Does anyone have any idea how this should be done with dates in Mailchimp? I can't find any iformation on that on either Mailchimp or anywhere else on the net.

You have to use the format 'YYYY-MM-DD'.
I was struggling with this, too, but I have the below working:
*|IF:VALIDUNTIL=2016-12-31|*
Vaild Member
*|ELSE:|*
Expired Member
*|END:IF|*

Don't know if this is a recent change, but Roger's answer only works for exact date comparison.
*|IF:JOINED=2017-01-31|*
You joined ON jan 31st
*|ELSE:|*
You joined literally any other date
*|END:IF|*
If you want to use comparisons, they work the same as any other merge tag (But only in the YYYY-MM-DD format)
*|IF:JOINED>2017-01-31|*
You joined after January 31st 2017
*|ELSE:|*
You joined before January 31st 2017
*|END:IF|*

Related

Using REST to filter Share Point date field

I need to filter the date in wish an item was received in a SharePoint list using REST. I have it partially working, but I have a problem. I'm using a Datepicker to select the date I'm using as filter, but when the date is picked and converted to an acceptable format using toISOString(), I get an "exact" date (e.g. 2018-06-15T00:00:00.000Z). The issue with that is that the Date portion (2018-06-15) matches OK, but not the Time portion, because the datepicker will always give a different time (HH:MM:SS) than the SharePoint list entry.
This is what I'm using:
... $filter=Date_Received eq datetime'2018-05-11T04:00:00.000Z'
I have several items that were entered on 6/15/2018, but I get no values, because the time they were entered was different (e.g. 2018-06-15T05:00:00Z). Is there a way to use something like substringof to filter dates, or does anyone has a workaround?
Thanks in advance.
Dates in SharePoint are stored in GMT. So the times recorded are London times.
Option 1 - Use ranges:
$filter=Date_Received gt datetime'2018-05-10T20:00:00.000Z' and Date_Received lt datetime'2018-05-11T20:00:00.000Z'
If you are not looking for files near midnight then:
$filter=Date_Received gt datetime'2018-05-11T00:00:00.000Z' and Date_Received lt datetime'2018-05-11T23:59:59.000Z'
Option 2 - Use the SharePoint 2010 REST API and date functions:
/sites/yourSite/_vti_bin/listdata.svc/yourList?$filter=year(Date_Received) eq 2018 and month(Date_Received) eq 5 and day(Date_Received) eq 11
This still has an issue for dates around midnight due to GMT.
Option 3 - Use SharePoint 2010 REST API with a calculated column:
Add a Calculated column named Date_Received_Text as: =TEXT(Date_Received,"yyyy-mm-dd")
/sites/yourSite/_vti_bin/listdata.svc/yourList?$filter=Date_Received_Text eq '2018-07-08'
Same midnight issue...
Note: The 2010 API still works in SharePoint Online.

Identify and name a timestamp for specific data entry points

I have a situation where I'm trying to look at changes in data based on timestamp of user entry (or 'created on').
The data highlights planning for delivery of goods, users have the ability to 're-plan' their dates of entry.
What I need to do is look at the timestamp for each 're-planning' date and be able to tell if the date of planning was changed within 7 days of delivery. For example
Data line XXY was planned for delivery on the 29th of August, 2017...but was changed, ON the 27th, to the 30th....this is a flag...
Like wise XXZ was planned for the 30th but changed to September 15th on the 29th...also a flag. Both were changed within 7 days of their previous 'delivery' date. Does this make sense and is there a simple way to do this?

IBM Watson Assistant: How to get just few numbers with System entities sys-number

I have some Business rule to follow.
I need to request for the user one Year, and currently, I'm using #sys-number to get the Year and other data if need numbers.
I want to know if have some form to get the #sys-number with just 4 digits, like:
Watson: What the year, please? Format example: - 2017
User say: the year is 17 (#sys-number get the 17 fine)
User say: the year is 2017 (#sys-number get the 2017 fine)
I need: ONLY If the user types the 4 numbers from the year, the condition #sys-number[4] //I don't know will get the year correctly and the Conversation will flow.
My condition currently within the node is:
if bot recognizes #sys-number
You could use two predicates:
if #sys-number and #sys-number>1000
The first would make sure that really a number was entered, the second predicate would take care of 4 digits. You could even add another predicate and limit the range of valid years.

VB Script for date extraction and formatting

I work on OCR. We extract text from invoices automatically. When the contents of the invoice are extracted they are stored in a text file, and then we write scripts to extract the data from the text file according to our requirements.
One requirement that has got me stuck is, I need to extract the date from a text file which is not written in any particular format. Its written as 12 08 2014 in a line. I need to extract this and print it out in the dd/mm/yyyy format.
Also, the dates can be written in any format, for example 2nd December 2013, 12-12-2013, 12 Aug 2013 and so on. I need to read the date and extract it in the form of dd/mm/yyyy.
A little heads up for the problem.
There is no fixed location for the date. There are about 14000 invoices, most have a separate location of the date and separate format. I get the images and the scanned text file of the invoices, and i have to locate the date and try to format it.
The date is not after any fixed keyword that i could use. Like i mentioned in the first point, it can be after the word invoice number, or cost or any other work. SO the idea of searching it using keywords does not work as well.
This is the most stupid one, suppose I get the date 1/2/2011, how do I know whats the day and whats the month? The client has just entered a date, i have no way of finding out whats the day and the month. Is it even possible to find this out?
ORDERED SHIPPED
01239751 28 08 14 03 09 14 E31192-00 1
CUST.NO. ItN1 R 0 R NO SALE MM
NOM CI WATT VOTRF NO nr CAMMANOF in-W.01M
ADDRESS HERE
Te1:(123)123-1234/ Fax:(123)795-1234
Facture / Invoice
OUTPS:R-103958989 CONE:MONS Taws> NET 60 DAYS
SOLD TO / VENDU A SHIPPED TO / EXPEDIE A
You've already asked this.
You don't know and there is no way to know. We normally base it on the locale of the computer how dates are read. Yanks do m/d/y while the rest of the world do d/m/y. In the US windows functions assume the first and in the rest of the world the second.
As to years. Two digits are interpreted according to control panel settings. 29 and below is 2000 to 2029. 30 and above is 1930 - 1999.
Computers can not read the minds of people who write dates.

EOM date for various months

I'm looking to get a snapshot of inventory for the latest date of each month.
I.E.
Feb 13
Jan 14
Feb 14
There are duplicate variables - i.e., "a" will be listed several times each month. I need to get a.) the sum of each month (easy), and b.) the snapshot of the last date available.
Part B.) is what I'm having trouble with. I've seen the EOM excel formula - but it requires entering (current, following month, etc.). I just want the formula to spit out the inventory Quantity for the last date of each month, without having to specify which month (current, following, etc.).
Any ideas?
Thanks!
I'm assuming that your data is structured something like this:
http://i.stack.imgur.com/mF3h0.png
If that is the case, you can use a formula like this:
=VLOOKUP(EOMONTH(A12,0),$A$2:$B$5,2,FALSE)
Where A12 is the month you want to find the answer for. So the full sheet looks like this:
http://i.stack.imgur.com/GR5ok.png
As you can see, the formula that I put into cell B12 and then just dragged down is pulling back the correct values for the end of month inventory count. Just populate column A with the month-year you are searching for.
Hope this helps!