0

Is it possible to create a conditional highlight in Einstein Analytics

I have this following query:

q = load "Santher2_new";
result = group q by 'categoria';
result = foreach result generate q.'categoria' as 'categoria', 
sum(q.'Volume_Quantidade') as 'quantidade',
(case when sum(q.'Volume_Quantidade') < 1000 then "#FF0000" else "#00FF00" end) as 'A';
result = order result by ('categoria' asc);
result = limit result 2000;

And I'm struggling if it's possible to bind the A alias to any property in visualizationParameters Json Attribute, my idea is to set different colors for each range in the query.

0

I have done this a few times where I wanted to change the background color of text widgets to show a positive or negative change in a metric. The binding needs to be added to the widget properties in the gridLayouts section of the JSON. Below is an example of the JSON.

{
     "colspan": 2,
     "column": 2,
     "name": "text_8",
     "row": 14,
     "rowspan": 2,
     "widgetStyle": {
          "backgroundColor": "{{cell(STEP_NAME.result, 0, \"A\").asString()}}",
          "borderColor": "#E6ECF2",
          "borderEdges": [],
          "borderRadius": 16,
          "borderWidth": 1
       }
 },

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.