Monday, March 13, 2017

Is there a way to show up and down arrows with colors on a widget in a wave dashboard?

Here is a cool example how @terence.wilson came up with up and down arrows for widget display:
(PS: at this point in time, it does require some saql editing)




1-first here are the buttons :  ▲  , ▼  ,  and ◄ ►   (you can copy and paste in the case statement directly - no need to lookup the shortcut keyboard keys)
2-you need to create a SAQL step to produce the desired outcome (the arrows) using a case statement: alternatively you can apply this in the dataflow using a saqlexpression:
(case when 'perc_Roll' > 0 then \"▲\" when  'perc_Roll' < 0 then \"▼\"  else \"◄ ►\" end) as 'diff_arrow')
3-utilize the outcome of the saql step in a binding example in a text widget:
(
            "text_1": {
                "parameters": {
                    "fontSize": 24,
                    "text": "{{coalesce(cell(housepurchase_Roll_7on7.result, 0, \"diff_arrow\"),\"◄ ►\" ).asString()}}",
                    "textAlignment": "left",
                    "textColor": "#9271E8"
                },
                "type": "text"
            },
)


No comments:

Post a Comment