Beastmode to calculate column based on minimum date case

Hi All,

 

I am running with a error with a below beast mode formula :

SUM(CASE WHEN DATE_FORMAT(`Date`,'%m') IN (DATE_FORMAT(DATE(MIN(`Date_INT`)),'%m')) THEN `ColumnA` END)

What i am trying to do here is sum column A when the condition for month number is same month number to minimum date(first date) in the column but this giving me an error with no output.

Need some suggesstion how can i achieve this. I tried using date_format() without date() in the formula but still has the same error.

Comments

  • ST_Superman
    ST_Superman Domo Employee

    Could you provide a small sample of your data set?  I think it might help to understand how the data is structured and what your expected calculation is.

     

    Also, it looks like you are trying to track sales (or something similar) for the first month of a customer.  I would probably suggest engineering at least one field in your data set so that you have an `initial_purchase_date` for each customer_id

     

    I think I could help more if you are able to share some of your data.