Charting

Charting

Adding comments in Beastmode calculations

This is a stupid question... but how do I write comments in Beast Mode calculations?

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answers

  • Coach
    Answer ✓
    1. -- This is a comment
    2. SUM(`Column`)
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Answer ✓

    Amazingly fast answer by @GrantSmith :)

    Beast modes also accept /* */ as comment blocks, such as this:

    1. /* check to see if the shift is in 
    2. the same day */
    3. (CASE WHEN DATE(`startdate`) = DATE(`enddate`) THEN
    4. /* same day*/
    5.  /* check to see if the start hour is too early */
    6.  (CASE WHEN HOUR(`startdate`)< 9 THEN
    7.  /*move the start date to 9 */
    8.  ADDTIME(DATE(`startdate`),9*60*60)
    9.  /* check to see if the start hour is too late */
    10.  WHEN HOUR(`startdate`)>17 THEN
    11.  /*move it to the next day and start at 9 */
    12.   ADDTIME(ADDDATE(DATE(`startdate`), interval 1 day),9*60*60)
    13.  ELSE TIMEDIFF(`enddate`,`startdate`)
    14.  END
    15.  )
    16.  ELSE
    17.  /* spans multiple days */
    18.  TIMEDIFF(`enddate`,`startdate`)
    19.  END
    20. )

    This is useful if you have a multi-line comment you want to write.

    **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

  • Coach
    Answer ✓
    1. -- This is a comment
    2. SUM(`Column`)
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Answer ✓

    Amazingly fast answer by @GrantSmith :)

    Beast modes also accept /* */ as comment blocks, such as this:

    1. /* check to see if the shift is in 
    2. the same day */
    3. (CASE WHEN DATE(`startdate`) = DATE(`enddate`) THEN
    4. /* same day*/
    5.  /* check to see if the start hour is too early */
    6.  (CASE WHEN HOUR(`startdate`)< 9 THEN
    7.  /*move the start date to 9 */
    8.  ADDTIME(DATE(`startdate`),9*60*60)
    9.  /* check to see if the start hour is too late */
    10.  WHEN HOUR(`startdate`)>17 THEN
    11.  /*move it to the next day and start at 9 */
    12.   ADDTIME(ADDDATE(DATE(`startdate`), interval 1 day),9*60*60)
    13.  ELSE TIMEDIFF(`enddate`,`startdate`)
    14.  END
    15.  )
    16.  ELSE
    17.  /* spans multiple days */
    18.  TIMEDIFF(`enddate`,`startdate`)
    19.  END
    20. )

    This is useful if you have a multi-line comment you want to write.

    **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.
  • It also formats lines beginning with # as if they are comments, but does not actually treat them as such.

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In