Cognite Charts: IF/ELSE Functions for Calculations [Community Contributed]

Userlevel 2

On Behalf of Charts super users at Clear Lake:

I would like the ability to incorporate “If/Else” statements as a function in Charts similar to what is capable in Excel. There are some calculations that rely on certain conditional parameters to be met in order to define which mathematical approach must be taken.


Best answer by Anita Hæhre 4 July 2023, 10:09

View original

6 replies

Userlevel 3

Hello, Christian.

Perhaps this will help. We have a logical check function that might help here.

Perform a logical check between time series/constants and returns the assigned time series/constants when the condition holds true or false. The logical check is performed following the format: Value 1 {operator} Value 2, where the operator can be Equality (==), Inequality (!=), Greater than (>), Greater or equal than (>=), Smaller than (<) or Smaller or equal than (<=)


Here is an example of it being used:


Best regards, Knut

Userlevel 2

Hi Knut,

I believe this might be what the users were looking for! I will follow up if there are any more questions or concerns. Thanks!

Userlevel 6

Hi @crgomez13 just following up to see if the above is what your users are seeking? 

Userlevel 2

Hi Anita,

This covers what was needed by the user. Thanks

Userlevel 6

That is great @crgomez13, thanks for confirming. We’ll close this thread for now, but feel free to reopen it anytime 🚀

Userlevel 4
Badge +2

Hi @crgomez13,

Thanks for all your great contributions in our community! We’ve chosen to move your article to our hub's How-To section as it will greatly benefit other members of our community. Thank you for your understanding, and we look forward to seeing more great contributions from you in the future! 

Best regards,