View with new tests from last few days

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
cichockia
Posts: 38
Joined: Fri Sep 19, 2014 4:41 pm

View with new tests from last few days

Post by cichockia »

Hello,

How to create a view that shows tests that have been added in the last 7 days
I used the "using expression" option:
('% CreatedTime%' getword 1)> = '% fvar_date_7_days_ago%'
"fvar_date_7_days_ago" - calculated date today minus 7 days in the format "yyyy-mm-dd"
Unfortunately, the view also shows tests from 7 days ago.

Where is the mistake, any ideas

Thank you in advance for your help
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is extra space chars after %, better remove it
'% CreatedTime%'
'% fvar_date_7_days_ago

Such expression will be compared as 2 strings so result depends on Windows regional settings.
E.g.
yyyy/mm/dd: ('2019/10/20' >= '2019/10/13) will be compared as you need
dd/mm/yyyy: ('20/10/2019' >= '13/10/2019) will not works in the way you need because string like '20/10/2015' > 13/10/2019

Regards
Alex
cichockia
Posts: 38
Joined: Fri Sep 19, 2014 4:41 pm

Post by cichockia »

Hello,
Special characters added during copying, they are not present in the configuration, the condition looks like this:
('%CreatedTime%' getword 1) >= '%fvar_date_7_days_ago%'

The local date format is YYYY-MM-DD, so it seems that the comparison should work as expected, unfortunately it doesn't work.

I did the ping test and entered in the "Tune up Replay value" field:
('%CreatedTime%' getword 1) - '%fvar_date_7_days_ago%'
The result in the Reply field is:
('2019-11-05 11:30:17' getword 1) - '2019-10-29'
It seems that it should be OK and not a view still returns tests added a few years ago.

The cause was determined, it is about the scope of variables.
The condition works incorrectly for tests that are located in directories with "Use folder variables only"
So my variable %fvar_date_7_days_ago% needs to be mapped to global
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

The condition works incorrectly for tests that are located in directories with "Use folder variables only"
Do you mean you have some sub-folders that do not inherit variables from parent and you did not specify variable for these sub-folders?
Then expression works correctly, because any date string starts with number, '0'>'%' so any_date>unresolved_variable, result=True, test fits expression

Regards
Alex
Post Reply