Skip to main content
Answer

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

  • June 6, 2023
  • 6 replies
  • 121 views

crgomez13
Committed

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

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

6 replies

Knut Vidvei
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • June 7, 2023

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


crgomez13
Committed
  • Author
  • Accenture
  • June 8, 2023

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!


Anita Hæhre
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Community
  • June 26, 2023

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


crgomez13
Committed
  • Author
  • Accenture
  • July 3, 2023

Hi Anita,

This covers what was needed by the user. Thanks


Anita Hæhre
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Community
  • Answer
  • July 4, 2023

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


Dilini Fernando
Seasoned Practitioner
Forum|alt.badge.img+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,
Dilini