Forum Discussion
HamzaJ
07-20-2023Data Integration
Hey ushadow91
What syntax error are you getting? The first error I see is the DDIFF. It doesnt include an end-date (in your case today). It should be something like MAX(DDIFF(NOW(),Days Difference)) . DDiff's need to be in an aggregate such as sum, min, max. Unless you are on Windows or have the Analytical Engine disabled, then you can do it without an aggregation
ushadow91
07-20-2023Data Storage
Thanks HamzaJ I'm getting
- "Unexpected Token '[' in FunctionParameters Definition".
- "Unexpected token')' in Boolean expression"
sum([All Tickets],
CASE
WHEN MAX(DDIFF(NOW()[Days Difference])) >1
THEN sum([All Tickets])
WHEN MAX(DDIFF(NOW()[Days Difference])) < 1
THEN 0
end)
- HamzaJ07-20-2023Data Integration
You forgot the , . Try the following:
sum([All Tickets], CASE WHEN MAX(DDIFF(NOW(),[Days Difference])) >1 THEN sum([All Tickets]) WHEN MAX(DDIFF(NOW(),[Days Difference])) < 1 THEN 0 else 0 end)