app studio text

I am starting to use App Studio and would like to do something creative with text. I would like to give a description of charts with text. For example, i would like to create some conditions such as ''met budget'' and to have this in green, otherwise if we did not hit budget to say 'miss budget' based on numbers. Is there any way to represent this? Also is there any way to call the month (August) as a variable or otherwise?

Tagged:

Best Answer

  • DavidChurchman
    Answer ✓

    My favorite way to do this is in the summary number. You can apply HTML formatting tags to summary numbers. Here's an article with some examples:

    https://domo-support.domo.com/s/article/360043430093?language=en_US

    I sometimes will use a text card with blank text and only a summary number, since I have more control over the formatting of the summary number than the card itself.

    For your case, depending on how your data is set up, your summary number could be something like:

    CASE

    WHEN SUM(`VALUE`) < AVG(`BUDGET`) THEN

    CONCAT('<div style =color:#009E73; font-size:18px; font-weight:900; background-color:#beedd7>',

    'Met budget', '</div>')

    else

    CONCAT('<div style =color:#D55e00; font-size:18px; font-weight:900; background-color:#ffdac4>',

    'Miss budget', '</div>')

    END

    I threw in some other formatting tags you might want in addition to text color.

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.

Answers

  • DavidChurchman
    Answer ✓

    My favorite way to do this is in the summary number. You can apply HTML formatting tags to summary numbers. Here's an article with some examples:

    https://domo-support.domo.com/s/article/360043430093?language=en_US

    I sometimes will use a text card with blank text and only a summary number, since I have more control over the formatting of the summary number than the card itself.

    For your case, depending on how your data is set up, your summary number could be something like:

    CASE

    WHEN SUM(`VALUE`) < AVG(`BUDGET`) THEN

    CONCAT('<div style =color:#009E73; font-size:18px; font-weight:900; background-color:#beedd7>',

    'Met budget', '</div>')

    else

    CONCAT('<div style =color:#D55e00; font-size:18px; font-weight:900; background-color:#ffdac4>',

    'Miss budget', '</div>')

    END

    I threw in some other formatting tags you might want in addition to text color.

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.

  • thanks this is VERY helpful. here is the problem i am facing now… When i try this it just resolved to a number when my beast mode is a case statement which has text…..

  • Sorry, I meant the "summary number" that's part of any analytics card. I don't think you can apply html tags to smart text within a text card (unless someone knows a way to do that?) The other warning is that HTML tags don't show up in previews; you have to save and close a card to see the formatting applied. Finally, I find these generally work best when you aggregate the values (i.e., put them inside a sum or avg or other aggregating function). Unless your dataset is a single row, it will struggle to combine values and text.

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.