COUNT(DISTINCT CASE WHEN THEN)

Nathan_Mahler
Nathan_Mahler Member
edited March 2023 in Datasets

I am not sure why this formula is working, it seems fairly straight forward but I am just becoming a regular SQL user and our company just adopted DOMO. Any ideas?

COUNT(DISTINCT CASE WHEN `Account.Status__c` LIKE 'Cancel%' THEN 'Canceled')

Best Answer

  • MarkSnodgrass
    Answer ✓

    You are missing an END statement for your CASE statement

    COUNT(DISTINCT CASE WHEN `Account.Status__c` LIKE 'Cancel%' THEN 'Canceled' END)
    


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    You are missing an END statement for your CASE statement

    COUNT(DISTINCT CASE WHEN `Account.Status__c` LIKE 'Cancel%' THEN 'Canceled' END)
    


    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Oh I should've noticed that, ahh well rookie mistake