Company establishment date

Hi Silverfin

I want to search for alle companies established after 01/07/2013.
I’ve added the code to our template ‘Checklist WCO’ because i think it’s not possible to directly take this over from the ‘Bedrijfsparameters’.
But i still don’t get a result. What am i doing wrong?

image

Hi @sylvia.debaeremaeker,

Another great case, and unfortunately you cannot access info from the company-drop unless you create a result tag somewhere, just like I proposed here:

So if you are planning on having a lot of queries, it might be an idea creating a specific reconciliation that takes all kinds of results…

Hope this works for you!

Hi Sven

I must be doing something wrong.

This is the code i’ve added to our reconciliation template:

{% comment %}value establishment date needed for SF INSIGHTS{% endcomment %}
{% result ‘company_establishment_date’ company.custom.establishment.date %}

This is what i’ve added in Insights:
image

This is my result:

  1. I don’t get the exact date
  2. Companies established in 2018 such as Advocatenkantoor Klara Van Herendael also appear in my list.

Hmm, I see

It looks like SF Insights is taking the value of that particular date as a numeric value (as you can see in the screenshot), which isn’t good and should be fixed.

You can go around this by expressing a date in a numeric value instead of a date, which we sometimes do to calculate with dates:

{% comment %}
the date "1/3/2017" can be expressed by a numeric value with the %s date filter
doing that, the date will be expressed in seconds with the value 1488326400
{% endcomment %}
{% input company.custom.establishment.date as:date %}
{% assign establishment_date = company.custom.establishment.date | date:"%s" %}
{% result 'establishment_date' establishment_date %}

Then, in Insights you change it to this:
36

Hope that works for you, this workaround as I’ll investigate with our developers why we couldn’t get this working from the start.

Hi Sven

This seems to work. Just one question: how do you become the number 1488326400?
Because i also need insights information for companies established after 01/07/2013.

Glad it works @sylvia.debaeremaeker :ok_hand:

The date filter %s is actually expressing a date into the Number of seconds since 1970-01-01 00:00:00 UTC.

So if you have a date entered somewhere, and you like to know how many seconds it was since 1970-01-01, then all you need to do, is something like:

{% assign date_to_s = custom.some.date | date:"%s" %} 
{{ date_to_s }} 

We do this sometimes to compare two dates for example, to see which one is the oldest.

PS

Because i also need insights information for companies established after 01/07/2013.

Then you’ll have to change the query into establishment_date > 1488326400
(as there will be more seconds for any date after 1/7/2013)

Just an update @sylvia.debaeremaeker: this has been added to our feature request list.

So for now, the workaround proposed is the only solution.