(imported topic written by tostroff91)
I’m writing an analysis that will examine both the absolute free space (in GB) and percentage free space (in percent) on the C: drive of managed clients. I’m running into a logic problem in my Relevance due to the 1st digit of the string containing the disk free space or the percent free space overruling the total value of the number. My disk currently has > 100GB free, so if I run a QnA query to see if the disk space is less than “120” I get a result of True (which is correct) but if I query if it is less than “2” I also get a result of True, since the first digit of “120” is a “1”. I thought I could get around this by using ‘as integer as string’ but it didn’t seem to help. Please see examples below, and let me know what number format to use rather than ‘integer as string’. Thanks!
====================================================
Free Space
Q: (free space of drive “C:” / 1070000000) as integer as string
A: 115
Q: (free space of drive “C:” / 1070000000) as integer as string = “115”
A: True
Q: (free space of drive “C:” / 1070000000) as integer as string < "
A: True
Q: (free space of drive “C:” as integer / 1070000000) integer as string < “2”
A: True
====================================================
Free Percent
Q: (free space of drive “C:” * 100 / total space of drive “C:”) as integer as string
A: 77
Q: (free space of drive “C:” * 100 / total space of drive “C:”) as integer as string = “77”
A: True
Q: (free space of drive “C:” * 100 / total space of drive “C:”) as integer as string <“90”
A: True
Q: (free space of drive “C:” * 100 / total space of drive “C:”) as integer as string <“8”
A: True