IBM Watson Assistant: How to work with dates? - ibm-cloud

I am working on a chatbot that allows users to compare their spending by 2 periods (e.g. spending in 1/1/19-2/2/19 vs spending in 1/1/20-2/2/20). We hope to detect the dates below from customer input:
Transaction date from (DDMMYY)
Transaction date to (DDMMYY)
Comparison date from (DDMMYY)
comparison date to (DDMMYY)
Some customers may say "I want to compare my spending of Jan 2019 with Feb 2020".
My questions are
if customer only types Jan 2019 (instead of giving me the date, month and year - 01/01/19), how can we generate the date 01/01/19 from input "Jan 2019"
how can we tell "transaction date from" = 01/01/19 (also for "Transaction date to", "Comparison date from" and "comparison date to"). Should I set 4 entities?
Note: we are not using a language without annotation feature.

Related

In Which format the date is given?

I have downloaded a dataset called Real estate valuation data set from https://archive.ics.uci.edu/ml/datasets/Real+estate+valuation+data+set?source=post_page . But I am not able to understand in which format the transaction date is given. They have given some examples like 2013.250=2013 March, 2013.500=2013 June, etc.
I encountered this same problem and I figured that the months were represented as a fraction of a year. So, for instance, June is the 6th month of the year, hence it is 6/12 = 0.5; that's why we had June 2013 as 2013.500, etc.

Is there a way to format and sort dates in a drop-down list on Google Sheets?

I have made a monthly budget sheet for someone who is not too confident using Google Sheets (or Excel) so I need it to be really simple.
https://docs.google.com/spreadsheets/d/10E9jX1Qlq-KQLCHupci3_8MiP7p5l-f2J1M5yFtfjQ0/edit?usp=sharing
In the monthly report, it is possible to select a month in cell B1 to fetch the relevant amounts using sumproduct/hlookup formulas.
Now that person should write "April 2019" or "May 2019" etc.
I would like to insert a dropdown list so there is no format issue whatsoever and for the items to be shown this way:
April 2019
May 2019
June 2019
...
with something like 24 months available.
I made a dropdown list from a formatted cell range but the dates display as "01-04-2019, 01-05-2019, etc" so it is not visually easy without an "mmmm aaa" format
AND
are not sorted chronologically (although my cell range is, but they rearrange themselves after 1 selection)
Going further, the dropdown would ideally have:
months in the format "mmmm yyyy"
sorted chronologically
dynamic list (12 months history, no future months)
this will give you dynamic dates in the range of (today's month +1) 2018 until (today's month +1) 2019
=ARRAYFORMULA(UNIQUE(TEXT(TO_DATE(ROW(
INDIRECT("A"&EOMONTH(DATE(YEAR(TODAY())-1, MONTH(TODAY())+1, 1), -1)+1):
INDIRECT("A"&EOMONTH(DATE(YEAR(TODAY()), MONTH(TODAY())+1, 1), 0)))),
"mmmm yyyy")))

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?

Changing from fiscal to calendar year

I am working on a dashboard where the user wants to change dates from a fiscal year to a calendar year from January 2017 going forward while keeping all data and continuing to display data prior to the change date in fiscal year format.
I have looked at using a calculated field with dateadd clocking the date back a month but it skews the data when the gap between fiscal and calendar month is rolled into 2017.
Has anyone encountered this issue?

Set Tableau dates show show previous month going back 12 months

I need to modify some Tableau dashboards so that they show from the previous month going back 12 months.
For example, it is August 2017 now, so the company wants to see the 12 months ending at July 2017. In other words: Aug 2016, Sept 2016, Oct 2016...June 2017, July 2017.
Using Tableau's relative date filter, users can easily select "previous month" (July 2017) or "previous 12 months" (Sept 2016-Aug 2017) on the relative date filter. But they can't choose previous month going back 12 months (Aug 2016-July 2017).
I was thinking of writing a formula that sets current month as 0, previous month as 1, month before that as 2 etc and that way I can filter to only show months 1, 2, ...12. And not show month 0, the current month.
Is this the best approach? I thought Tableau would have an option for this - surely a lot of companies want to see a year worth of data ending at the previous month? (Since the current month is not yet complete so they don't want to see a partial month's data).
Thanks for your ideas!
You are right about this being a common requirement. I do 'Last 12 months' filter too which excludes current month since it is not a full month.
In my case I have defined a True/False type calculated field which I use to filter records which show in the dashboards.
Here is the formula that I use:
DATEDIFF('month',[My Timestamp Field],Today()) < 13 and DATEDIFF('month',[My Timestamp Field],Today()) > 0