Comparing the value of setting and folder size

Hello,

I am trying to do a comparison of the results between:

-size of the Archive folder from BES Client machine
Q: sum of (sum of sizes of descendants of it) of folder ((pathname of parent folder of regapp “besclient.exe”) & “__BESData__Global\Archive”)
A: 1521270
T: 0.031 ms

-value for the MaxArchiveSize setting
Q: values of settings “_BESClient_ArchiveManager_MaxArchiveSize” of client
A: 20971520
T: 0.019 ms

But I am geting this error:

Q: (values of settings “_BESClient_ArchiveManager_MaxArchiveSize” of client) > (sum of (sum of sizes of descendants of it) of folder ((pathname of parent folder of regapp “besclient.exe”) & “__BESData__Global\Archive”))
E: A singular expression is required.

What would be the proper way of doing the comparison? I am trying to check machines that would require increasing of their MaxArchiveSize setting value

Thanks in advance for any feedback.

Try value of setting to return a singular value. You may also need to cast the result as an integer to be able to perform the comparison.

You may also need to cast the value to integer as it would be a string type result. Maybe also worth error trapping to avoid errors on systems that maybe do not have the setting yet?

Q: value of setting "_BESClient_ArchiveManager_MaxArchiveSize" of client 
A: 999
T: 0.167 ms
I: singular string

Q: value of setting "_BESClient_ArchiveManager_MaxArchiveSize" of client as integer | 0
A: 999
T: 0.272 ms
I: singular integer

If the setting doesn’t exist

Q: value of setting "_BESClient_ArchiveManager_MaxArchiveSize" of client 
E: Singular expression refers to nonexistent object.

Q: value of setting "_BESClient_ArchiveManager_MaxArchiveSize" of client as integer | 0
A: 0
T: 0.081 ms
I: singular integer