# Rank Date

Here is a rank by date.
To create the YC compatible table, I had to add a math column to format the date in short format.
Note that I use in the attached list and divide the \ separator so as not to confuse ‘,’ which separates the date and time
I also had to use a convertion according to the format of dates by regions. I hope it will work for you

Source

EDIT V2
I found a bug
Uh, well I made a correction not super elegant but obviously it works

EDIT V3
I added an exception if the format of the Date array is not compliant (Short Format, Date & Time)

7 Likes

Hey @Manu.n

I have been trying to work on one that gives me an array of dates based on two specific dates but I’m stuck. Do you have any ideas on how to do it?

Lovely! Will add to Notion for the weekend.

I’m wondering if we can theoretically sort an array based on another array.

Let’s say I want to return a name column from the database above based on dates.

A | Yesterday
B | Tomorrow
C | Today

Can we have something to return an array of B, C, A based on the latest date (from the date column)?

A B C are arrays?

Maybe we can pass them in as arrays using a multiple relation/lookup or split text.

If I understood everything.

If the date = yesterday: return array A
If the date = today: return array B
If the date = tomorrow: return array C
???

No, I mean we sort one array by another array.

Say Array 1 = [“A”, “B”, “C”], Array 2 = [“Yesterday”, “Tomorrow”, “Today”].

This is derived from the table above with 3 rows.

A | Yesterday
B | Tomorrow
C | Today

Then I want to sort array 2 descendingly and at the same time change the index of their respective values in array 1.

After sorting (by time) descendingly.

Array 2 = [“Tomorrow”, “Today”, “Yesterday”]
Array 1 = [“B”, “C”, “A”]

To be clear, this is helpful with conducting templates for Quickchart/PDFs. @Jeff_Hager has been calling for this I think.

2 Likes

Yes it is possible (everything is possible).
This works as long as the 2 source tables have the same number of items

so,
I’m not sure to meet your expectations, but I did this:
Sorting of the Data array (a, b, c, …) according to the date sorting.
Sorting can be descending or ascending.

Source

2 Likes

That looks about right! I will try this weekend and report back.

1 Like

Hola Thinh,

Anything like it?

I sorted and ranked the result based on Number column and joined the Name to know “the winners”.

Sorry for PIC quality , I’m outside of my house without my laptop

Saludos

2 Likes

Yes man! That’s exactly what I wanted.

Previously charts generated through a joined text column does not go well due to the inability to sort the values, especially dates.

Now I can build better solutions with this. Thanks @Manu.n and @gvalero!

2 Likes

Well reporting back…

All the solutions work perfectly in the builder but it still appears empty to the webhook no matter what I try…

??? le webhook ??

I have to pass a list of data to the webhook to generate a PDFMonkey pdf for my client. This was working just fine before, only need the date sorting to perfect it.

Solutions work fine in the builder, but the values don’t get passed at all to the webhook.

Hey @ThinhDinh

@Francisco_Maldonado told me the exact same thing yesterday… He was trying to pass some info from a EC through a webhook but it did not work at all.

1 Like

Ah OK
what is the type of column in return, an array ??

Yeah, gotta hold it for now. Thanks for the info bro.

1 Like

It return a string.

to do a test, display the YC column in a text component for example, on the page with the Webhook action