-
1. Re: How to automate the calculation for quarter over quarter ratio
Deepak RaiJun 28, 2018 2:25 PM (in response to Helen Wang)
Q2'18 MGT DA
ZN(IF str(DATEPART('year',[Fiscal Quarter]))= '2018' AND str(DATEPART('quarter',[Fiscal Quarter] )) =STR({MAX(DATEPART('quarter',[Fiscal Quarter] )})
THEN [Ship Final Act-Fcst]
END)
Q1'18 MGT DA
ZN(IF str(DATEPART('year',[Fiscal Quarter]))= '2018' AND str(DATEPART('quarter',[Fiscal Quarter] )) =STR({MAX(DATEPART('quarter',[Fiscal Quarter] )}-1)
THEN [Ship Final Act-Fcst]
END
-
2. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jun 28, 2018 2:32 PM (in response to Deepak Rai)1 of 1 people found this helpfulHI Deepak,
I cannot figure out what parenthesis is missing.....could you please let me know?
ZN(IF str(DATEPART('year',[Fiscal Quarter]))= '2018' AND str(DATEPART('quarter',[Fiscal Quarter] )) =STR({MAX(DATEPART('quarter',[Fiscal Quarter] )}-1)
THEN [Ship Final Act-Fcst]
END
-
3. Re: How to automate the calculation for quarter over quarter ratio
Deepak RaiJun 28, 2018 2:50 PM (in response to Deepak Rai)
1 of 1 people found this helpfulQ1'18 MGT DA
ZN(IF str(DATEPART('year',[Fiscal Quarter]))= '2018' AND str(DATEPART('quarter',[Fiscal Quarter] )) =STR({MAX(DATEPART('quarter',[Fiscal Quarter] ))}-1)
THEN [Ship Final Act-Fcst]
END
Try now
-
4. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jun 28, 2018 3:30 PM (in response to Deepak Rai) -
5. Re: How to automate the calculation for quarter over quarter ratio
Deepak RaiJun 28, 2018 3:35 PM (in response to Helen Wang)
I used FIXED, If you have some filters, add Them to CONTEXT to get same Results
-
6. Re: How to automate the calculation for quarter over quarter ratio
Peter Fakan Jun 28, 2018 5:02 PM (in response to Helen Wang)Hi Helen,
Just responding from the other post, if you want to automate the calculations, using Deepak's response replace the '2018' with a parameter, and the Quarter selection with a current quarter parameter (1-4).
You can work out the previous quarter for your calculated fields using the same parameter that you use for current quarter with another calculated field (pseudocode below) or just add another parameter to let users set the previous quarter as well.
If [current quarter] = "1" then [last quarter] = "4" AND [Year] = [Year Parameter]-1
elseif [current quarter] = "2" then [last quarter] = "1"
elseif [current quarter] = "3" then [last quarter] = "2"
elseif [current quarter] = "4" then [last quarter] = "3"
END
HTH
Peter
-
7. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jul 6, 2018 1:20 PM (in response to Peter Fakan)https://community.tableau.com/message/787842#787842
Peter would you mind helping me with this question?
Have a nice weekend!
-
8. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jul 6, 2018 1:20 PM (in response to Deepak Rai)https://community.tableau.com/message/787842#787842
Peter would you mind helping me with this question?
Have a nice weekend!
-
9. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jul 6, 2018 1:21 PM (in response to Peter Fakan)https://community.tableau.com/message/787842#787842
Peter would you mind helping me with this question?
Have a nice weekend!
-
10. Re: How to automate the calculation for quarter over quarter ratio
Helen Wang Jul 6, 2018 1:21 PM (in response to Deepak Rai)https://community.tableau.com/message/787842#787842
Deepak would you mind helping me with this question?
Have a nice weekend!