and i want only month part should be extracted from the column that i have and there are various year in the same column, but i want to make their chart according to their months
Hello,
Â
in order to provide advice, we should see how this specific string column looks like.
You can use string modification functions like: LEFT, RIGHT, SUBSTRING, LEN, REVERSE, REPLACE to get only the part with date, and then use MONTH function after projecting it to date.
Â
Best regards,
Mateusz Dudek
Hello,
Â
in order to provide advice, we should see how this specific string column looks like.
You can use string modification functions like: LEFT, RIGHT, SUBSTRING, LEN, REVERSE, REPLACE to get only the part with date, and then use MONTH function after projecting it to date.
Â
Best regards,
Mateusz Dudek
in the date column month is in the numerical format like 1,2,3 and so on , so when i am trying to do the trim part forward slash is also coming so what can i do for that .fast response will be very helpful for me thankyou .
As I've said - the more screenshots the better we know the problem.
If you've got single characters, remove them with REPLACE formula.
Â
Here you've got the example that uses multiple functions to present how they work:
Month(TO_DATE ( RIGHT(REPLACE('STH2022-10-01/', '/', ''), len('STH2020-01-01/')-4 ), FORMAT ('%Y-%m-%d')))
Â
Effect:
Â
Best regards,
Mateusz Dudek
As I've said - the more screenshots the better we know the problem.
If you've got single characters, remove them with REPLACE formula.
Â
Here you've got the example that uses multiple functions to present how they work:
Month(TO_DATE ( RIGHT(REPLACE('STH2022-10-01/', '/', ''), len('STH2020-01-01/')-4 ), FORMAT ('%Y-%m-%d')))
Â
Effect:
Â
Best regards,
Mateusz Dudek
this is the format of the column that i have month/date/year in string format
In that case it's rather easy:
Month(TO_DATE("YourTable"."YourColumn", FORMAT('%m/%d/%d')))
In that case it's rather easy:
Month(TO_DATE("YourTable"."YourColumn", FORMAT('%m/%d/%d')))
Thankyou Mateusz for your help but the only thing that i am facing now is that , when i am trying to replace the month number with month name by using string i am not getting that in in the sequence according to the month , do we have another way to do this, thankyou
REMAP_VALUES(TO_STRING(MONTH(TO_DATE ( "table.columnname" , FORMAT ( '%m/%d/%Y' ) ))),
 '1','Jan'],,'2','Feb'],,'3','Mar'],,'4','Apr'],,'5','May'],,'6','Jun'],,'7','Jul'],,'8','Aug'],,'9','sep'],
 Â'10','Oct'],]'11','Nov'],]'12','Dec']
 )
any other method that i can use.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.