- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 08:35 AM
I recently discovered that I can end a formula with (for example) || 100 so that a percentage calculation would return 100 if there were no scores on a particular day - VERY useful and not really documented, only appears in some earlier forum posts.
Is there any other syntax I can use - I'd really like to say (if xxxx/yyyy > 100 then 100 else xxxx/yyyy) or words to that effect.
How much syntax and parsing actually occurs?
Solved! Go to Solution.
- Labels:
-
Performance Analytics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 08:55 AM
You should be able to use (simple) javascript expressions.
Your example could be like:
([[xxxx]]/[[yyyy]] > 100) ? 100 : [[xxxx]]/[[yyyy]]
Or shorter and in my opinion more readable
Math.min(100,[[xxxx]]/[[yyyy]])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 08:55 AM
You should be able to use (simple) javascript expressions.
Your example could be like:
([[xxxx]]/[[yyyy]] > 100) ? 100 : [[xxxx]]/[[yyyy]]
Or shorter and in my opinion more readable
Math.min(100,[[xxxx]]/[[yyyy]])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 11:22 AM
Brilliant - how do you know this stuff? Talk to all the right people?
Should it not be DOCUMENTED !?!?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-14-2017 12:46 PM
Glad it helped Mike!
I'm now part of the ServiceNow PA team, so I do talk with the right people now.
We'll do our best to make features like this more visible, through documentation and off course the community!
