Create a new variable in a Dashboard

Hello everybody,

Here is a screenshot of the analysis :

When QuantityARabiller_P1 = 0 the dashboard display “NULL” but I want it to display 0 %.

For example I want to be able to create a variable and bind it to the expression like this :

variable1 = round((sum(@QuantityARhabiller_P1 ) * 100) / sum(@Quantite OK_P2 ), 2) + ’ %’

And I want also to add this condition :
If @quantityArhabiller_P1 = 0 then variable1= 0 %

Is it possible to do that ?

Thanks

Best regards

Inas ELM

I believe you can use the LINK() function in the expression editor to get around this. LINK(…) returns the first non-null value in a list, much like the coalesce function in SQL. So, your expression might give you more what you are looking for if it were:
variable1 = LINK(round((sum(LINK(@QuantityARhabiller_P1,0)) * 100) / SUM(LINK(@Quantite OK_P2,0),2)),0)+ ‘%’

see the University tutorial at Feature Deep-Dive: Expression Editor

or the knowledgebase article on expression editing at Technical Details of the Expression Editor | Tulip Knowledge Base - Support for Building Operations Apps

@wkurth4008

4 Likes

It works !

Thank you.

1 Like