Forum

Discussions specific to version 8.1
Single Poster
Offline
User avatar
Posts: 1
Joined: Mon Apr 17, 2017 7:41 am

Unable to get Month Name

by Tulu » Mon Apr 17, 2017 7:48 am

Hi All,

I am using latest kognitio driver in my Tableau. After driver installed I did not get the month name by using the below formula in Tableau end.

Datename('month',([Date]))

Above function gives the output 1,2,3.....so on. But in other driver getting the result January,Frebuary,March........so on.

Please let me know how can I get the January,Frebuary,March........so on values by using the function. Thanks
Reply with quote Top
Contributor
Offline
User avatar
Posts: 21
Joined: Mon Oct 07, 2013 12:15 pm

Re: Unable to get Month Name

by ChakLeung » Tue Apr 18, 2017 11:16 am

Hi Tulu,

Could I ask which driver versions you are using to get the two different behaviours?


Although I suspect it's something on Tableau's end for interpreting the numbers returned using Datename as other users on their community forums have reported this as well, even when using the same function in different sheets.

The Datename function actually performs Datepart (which returns an integer) underneath and reinterprets this as a string which looks to be quite temperamental if you search for this issue online. So if you're querying for the month via Datename, the actual SQL being submitted to Kognitio looks like:

Code: Select all

SELECT
MONTH(<DATE_FIELD>) 
FROM <SCHEMA>.<TABLE>
GROUP BY 1
And essentially this is what Datepart does as well but Datename will apply a string to it instead.
If you look at the SQL submitted for my 1. solution below, you'll see that that submits the same SQL but Tableau interprets that one correctly.

A suggestion made online you could try is to use double quotes for "month" but this didn't work for me and some others.
But if the Datename function is not an absolute necessity then I can suggest two ways to do this which have always work for me:

1. Add your date pill to the column/rows shelves, right click the pill and choose to display as month
2. Create a custom date and choose months, this will create another dimension listing the months for you to use elsewhere like with calculated fields
Reply with quote Top

Who is online

Users browsing this forum: No registered users and 1 guest

cron