9 Replies Latest reply on Aug 25, 2018 8:41 AM by Mahfooj Khan

# Need to find max quarter's value where the quarter column is string datatype

I have a requirement where we need to find the data for MAX(Year-Quarter) where  Year-Quarter is string column. Some how i need to find the data for maximum Year-Quarter's data, with respect to this also i need to find the respective MOM and YOY for corresponding Year-Quarter.

Could anyone of you suggest a solution for this.

PFB screenshot for Year-Quarter column data: Please let me know if need additional informations.

Ajith V S.

• ###### 1. Re: Need to find max quarter's value where the quarter column is string datatype

Ajith,

create a calculation like

Year-Quarter= {max(Year-Quarter)}

put it on filter shelf and choose TRUE. This will give data for max Year-Quarter.

Thanks,

Ankit Bansal

• ###### 2. Re: Need to find max quarter's value where the quarter column is string datatype

Hi,

You can use DATEPARSE() date function to convert your string to date. Below calculation will convert your string to date

Note: Year-Qtr is your string field

DATEPARSE("yyyyQQQ",[Year-Qtr])

There are several ways to convert string fields to date. Follow the link

Then use below calculation to get the max date

Max Qtr: DATEPARSE("yyyyQQQ",[Year-Qtr])={MAX(DATEPARSE("yyyyQQQ",[Year-Qtr]))}

Use above calculated field in filters shelf and select true. It'll filter the max date from the data source.

Let us know if this work. Else share some sample mock up data.

Mahfooj

• ###### 3. Re: Need to find max quarter's value where the quarter column is string datatype

Hi,

I am using tableau 10.5 where DATEPARSE function is not available. Is there any other solution available.

Ajith V S.

• ###### 5. Re: Need to find max quarter's value where the quarter column is string datatype

HI Ajith,

Sometimes if you are using live connection you may not see "DATEPARSE" function.

Try using "Extract".

• ###### 6. Re: Need to find max quarter's value where the quarter column is string datatype

Hi,

We are using live connection. Even EXTRACT function is not available.

Thanks,

Ajith V S

• ###### 7. Re: Need to find max quarter's value where the quarter column is string datatype

Extract connection is not available???

Which data source are you using??

• ###### 8. Re: Need to find max quarter's value where the quarter column is string datatype

No, extract connection is not available. we are using live connection.