Forum Discussion

ramansingh89's avatar
05-01-2024
Solved

create custom measure on a dashboard

Hello,

I would like to create a custom measure on Sisense dashboard that can do the same this SQL is doing

SELECT
    COALESCE(SUM(CASE
        WHEN channel = 'Email' AND message_event_type = 'Dispatched' THEN count_of_engagement
        ELSE 0
      END
    ), 0) AS email_count_dispatched
FROM event;

Can anyone guide me on how to proceed with this?  

DRay 

  • Hey ramansingh89 

    It would be something like this;

    CASE
            WHEN (SUM(count_of_engagement),channel,message_event_type)>0 THEN sum(count_of_engagement)
            ELSE 0
          END

    If you want to sum this, then you probably would need a multi-pass aggregation within this formula. If you can share a screenshot of your widget I can help you finetune this. above formula will work (will work the best on a detailed level).

    Hamza

2 Replies