How to ensure data for each month gets displayed in one row in this table chart instead of2rows

Beast mode used

Approved Shifts = CASE WHEN `Approved` = 1 THEN SUM(`Total Charge`) ELSE 0 END

Unapproved Shifts = CASE WHEN `Approved` = 0 THEN SUM(`Total Charge`) ELSE 0 END

ST = SUM(`Total Charge`)

Kindly advise what could be done to rectify it. Thanks

Best Answer

  • GrantSmith
    GrantSmith Coach
    edited February 2022 Answer ✓

    @Abhijith

    wrap your entire case statement with the SUM instead of just the condition


    SUM( CASE WHEN `Approved` = 1 THEN `Total Charge` ELSE 0 END)
    


    SUM( CASE WHEN `Approved` = 0 THEN `Total Charge` ELSE 0 END)
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**

Answers

  • GrantSmith
    GrantSmith Coach
    edited February 2022 Answer ✓

    @Abhijith

    wrap your entire case statement with the SUM instead of just the condition


    SUM( CASE WHEN `Approved` = 1 THEN `Total Charge` ELSE 0 END)
    


    SUM( CASE WHEN `Approved` = 0 THEN `Total Charge` ELSE 0 END)
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Thanks, @amehdad

    Thanks, @GrantSmith