How to work a dynamic textbox

I want a simple card that says "Data through [Date]" where date is the latest/max date value in my dataset. How can I do this...?

I've tried using a Dynamic textbox, but I can't figure how to get this (seemingly easy function) to work.

Best Answers

  • MarkSnodgrass
    Answer ✓

    Create a beast mode that uses the date format function to format your date field in the format you want. Something like this:

    DATE_FORMAT(`transactiondate`, '%b %Y')

    Put this field in your category and then put a constant value in your values and choose any aggregation type. (You can even make a beast mode that has a value of 1 and put that in your values box and then choose sum)

    In the sorting properties, sort by your date field desc.

    In the General properties, in the Text property, type in Data through and then choose the Last_Category macro with the plus sign.

    This should render a display like this:


    **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.
  • MarkSnodgrass
    Answer ✓

    Ahh... I think I see the issue. Put your actual event date field in your sorting field and not the beast mode formatted field. I failed to notice in my own configuration that I have the actual date field in the sorting. Sorry I didn't catch that earlier.

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

    Create a beast mode that uses the date format function to format your date field in the format you want. Something like this:

    DATE_FORMAT(`transactiondate`, '%b %Y')

    Put this field in your category and then put a constant value in your values and choose any aggregation type. (You can even make a beast mode that has a value of 1 and put that in your values box and then choose sum)

    In the sorting properties, sort by your date field desc.

    In the General properties, in the Text property, type in Data through and then choose the Last_Category macro with the plus sign.

    This should render a display like this:


    **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.
  • This isn't working... I'm getting April 1 2022 when the latest date I have is a few days ago...

    Is there something you updated in teh Change Value Options that might impact this? I notice you made a change in there based on your screenshot.

  • I would check what is in your sorting properties. My change value options just had reverse color direction checked, which was just a remnant from a prior version of the card and wouldn't apply to this.

    **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.
  • Yeah, I followed your instructions and it isn't working. Surely there has to be a simpler way to do this, right???? This is so ridiculous.

  • I would check your filters or your date range to see if something is keeping it. You can also switch to a table card and see what date is at the bottom. Posting a screenshot of what your analyzer looks like might help me troubleshoot.

    **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.
  • The first screenshot is just a single value pulling the maximum date.

    This is the final result:


  • That is pretty strange. Mine went pretty smoothly. I would try toggling the sort order and see if that shakes it loose. Sometimes, saving and closing the card will cause it to actually render correctly. Also, I noticed in the first screenshot, there was no sort order, so it is just grabbing the date by how the data is stored in the dataset.

    **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.
  • The first screenshot was using a single value card just to show you the latest date is February 13 2023.

    I adjusted the sorting to descending (which you had initially prescribed) and it actually pushed the date back to April 1 2022.

  • MarkSnodgrass
    Answer ✓

    Ahh... I think I see the issue. Put your actual event date field in your sorting field and not the beast mode formatted field. I failed to notice in my own configuration that I have the actual date field in the sorting. Sorry I didn't catch that earlier.

    **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.
  • Okay that worked! Major kudos to you Mark.