Minimum of Instances

How can I get the minimum of instances of this statement?

if exists application usage summary "bzad.exe" then ((last time seen of it - now) / day * -1) of instances of application usage summaries "bzad.exe" else "never used"

I think I got it, but I had to change “Never Used” to 0.

if exists application usage summary "bzad.exe" then minimum of (((last time seen of it - now) / day * -1) of instances of application usage summaries "bzad.exe") else 0
1 Like

That makes an unused instance look the same as one used today.

Why not change the ‘else 0’ to else ‘-1’ (or -99) to identify those that have not been used (but may be used in the future)?

Thanks trn! That is a great idea.

If you did want to keep the ‘never used’ string, you should be able to if you cast the integer result ‘as string’ also

if exists application usage summary "bzad.exe" then ((last time seen of it - now) / day * -1) of instances of application usage summaries "bzad.exe" as string else "never used"

Jason, you did not use minimum in your relevance which was the point of the thread.

if exists application usage summary "bzad.exe" then (minimum of (((last time seen of it - now) / day * -1) of instances of application usage summaries "bzad.exe")) as string else "never used"
1 Like