MonthInCalendar - sort by not getting the desired results

Hi folks,
I can’t seem to get the filtered by correct…

I’m using the standard Date Table that they suggest in the EnterpriseDNA training. Specifically I need to provide the total unique accounts by month. A rather simple task, I have per day so to sum up the month i simply pulled in the “MonthInCalendar” field from the Date table. The data is correct, except that the months are messed up. I’ve tried the sort by column but nothing seems to put the dates in the proper order?

@chad.sharpe

1 Like

Hey Antriksh,
For some reason that doesn’t align the data properly. You can see from my screen shot it is off. I can’t explain with any logic how the sorting is taking place. The dataset goes from Feb 2020 to Feb 2021? When I take the data down to the day (date), as per the second graph all the dates align. For some reason it’s just when i try and use a month, it doesn’t sort properly?

@chad.sharpe Is your Year Month column sorted by Year Month Number column?

Hey Antriksh,
I figured it out… the specific field i was using was labeled as text. Once i labeled it as a date, then the sort kicked in. I figured that because the table was already classified and labeled as the date table along with the main column (per day) was correctly labeled as a date that it would push that date logic to the table.

image

1 Like

@chad.sharpe That’s great, I am interested in knowing how your sort by field looks like because I changed the data type in my model to text and it is still sorting correctly.

I figured it out…lol… tricky…
So the text data type is fine, as long as the column you are using to sort is a (Date) column. It then ignores the text sort and goes by the date.

But… if you are using MonthInYear as a (text), then using another column to sort this, but the other column is also a (text) then it will not sort properly.