This is the formula I am using but it keeps telling me Invalid Formula : This calculation contained a syntax error.
These are my headers:
The first part is how I got QTR Lbs. I would like to compare the differences Quarter over Quarter and then format it in percentage.
I am not sure what the error is.
(SUM((CASE WHEN ((YEAR(`StartDate`)=YEAR(CURRENT_DATE())) AND (QUARTER(`StartDate`)=QUARTER(CURRENT_DATE()))) THEN `LBS` ELSE 0 END )) and
(case
when right(`CurrentMonth`,2)-0 = '1' then 'Q01'
when right(`CurrentMonth`,2)-0 = '2' then 'Q01'
when right(`CurrentMonth`,2)-0 = '3' then 'Q01'
when right(`CurrentMonth`,2)-0 = '4' then 'Q02'
when right(`CurrentMonth`,2)-0 = '5' then 'Q02'
when right(`CurrentMonth`,2)-0 = '6' then 'Q02'
when right(`CurrentMonth`,2)-0 = '7' then 'Q03'
when right(`CurrentMonth`,2)-0 = '8' then 'Q03'
when right(`CurrentMonth`,2)-0 = '9' then 'Q03'
when right(`CurrentMonth`,2)-0 = '10' then 'Q04'
when right(`CurrentMonth`,2)-0 = '11' then 'Q04'
when right(`CurrentMonth`,2)-0 = '12' then 'Q04'
else 'Other' end))
-
(SUM((CASE WHEN ((YEAR(`StartDate`)=YEAR(CURRENT_DATE())) AND (QUARTER(`StartDate`)=QUARTER(CURRENT_DATE()))) THEN `LBS` ELSE 0 END )) and
(case
when right(`CurrentMonth`,2)-0 = '1' then 'Q01'
when right(`CurrentMonth`,2)-0 = '2' then 'Q01'
when right(`CurrentMonth`,2)-0 = '3' then 'Q01'
when right(`CurrentMonth`,2)-0 = '4' then 'Q02'
when right(`CurrentMonth`,2)-0 = '5' then 'Q02'
when right(`CurrentMonth`,2)-0 = '6' then 'Q02'
when right(`CurrentMonth`,2)-0 = '7' then 'Q03'
when right(`CurrentMonth`,2)-0 = '8' then 'Q03'
when right(`CurrentMonth`,2)-0 = '9' then 'Q03'
when right(`CurrentMonth`,2)-0 = '10' then 'Q04'
when right(`CurrentMonth`,2)-0 = '11' then 'Q04'
when right(`CurrentMonth`,2)-0 = '12' then 'Q04'
else 'Other' end))
/
(SUM((CASE WHEN ((YEAR(`StartDate`)=YEAR(CURRENT_DATE())) AND (QUARTER(`StartDate`)=QUARTER(CURRENT_DATE()))) THEN `LBS` ELSE 0 END )) and
(case
when right(`CurrentMonth`,2)-0 = '1' then 'Q01'
when right(`CurrentMonth`,2)-0 = '2' then 'Q01'
when right(`CurrentMonth`,2)-0 = '3' then 'Q01'
when right(`CurrentMonth`,2)-0 = '4' then 'Q02'
when right(`CurrentMonth`,2)-0 = '5' then 'Q02'
when right(`CurrentMonth`,2)-0 = '6' then 'Q02'
when right(`CurrentMonth`,2)-0 = '7' then 'Q03'
when right(`CurrentMonth`,2)-0 = '8' then 'Q03'
when right(`CurrentMonth`,2)-0 = '9' then 'Q03'
when right(`CurrentMonth`,2)-0 = '10' then 'Q04'
when right(`CurrentMonth`,2)-0 = '11' then 'Q04'
when right(`CurrentMonth`,2)-0 = '12' then 'Q04'
else 'Other' end))