6 Replies Latest reply on Aug 29, 2018 9:12 PM by Mahfooj Khan

# Graph to show only current QTD

Hi ,

I have a below graph which shows rolling 90 days but  currently I have to change it to show current QTD.

Our  current quarter starts from July 1 so I have to show only from July 1 instead of jun 1st.

is it possible to achieve this in Tableau?

• ###### 1. Re: Graph to show only current QTD

attached is the worrkbook

• ###### 2. Re: Graph to show only current QTD

Hi,

Hope you are looking this!!!

Please find attached workbook.

Regards,

Aman

• ###### 3. Re: Graph to show only current QTD

Hi,

Try this calculated field and put it on filters shelf and select "True". It'll always filter the latest quarter information from source.

DATETRUNC('quarter',[TXNDATE])={MAX(DATETRUNC('quarter',[TXNDATE]))}

Mahfooj

• ###### 4. Re: Graph to show only current QTD

hi Aman,

Can you send me the workbook in 10.2 version?Iam not able to open the workbook

Thanks,

• ###### 5. Re: Graph to show only current QTD

Hi Mahfooj,

IN the below calculation how does tableau know that the current quarter starts on july 1st

DATETRUNC('quarter',[TXNDATE])={MAX(DATETRUNC('quarter',[TXNDATE]))}

Thanks,

• ###### 6. Re: Graph to show only current QTD

Hi,

DATETRUNC() function truncates the specified date to the accuracy specified by the date_part (year/quarter/month etc.). This function returns a new date. For example, when you truncate a date that is in the middle of the month at the month level, this function returns the first day of the month. The [start_of_week] parameter, which you can use to specify which day is to be considered the first day or the week, is optional. Possible values are 'monday', 'tuesday', etc. If start_of_week is omitted, the start of week is determined by the data source.

e.g; DATETRUNC(date_part, date, [start_of_week])

`DATETRUNC('quarter', #2004-08-15#) = 2004-07-01 12:00:00 AM`

`DATETRUNC('month', #2004-04-15#) = 2004-04-01 12:00:00 AM`

When you get the first date then using {MAX()} LOD expression we can find the first date of latest quarter.

Hope this help. Let me know if you've any query.

Mahfooj

1 of 1 people found this helpful