Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
laujerry
Creator
Creator

time comparison in set analysis

i want to filter data according to the time field "create_time" in an expression:

Count(

   {$<

      [create_time]={'>=$(=$(time_1530))'}

   >}

   DISTINCT [order#]

)

"time_1530" is defined as Time#('15:30')

then it shows no data at all

by removing the set analysis the result shows properly

so is there any problem with my expression?

thanks for any help

1 Solution

Accepted Solutions
Not applicable

Hi Jerry,

     Would like to know is the field "create_time" really a time? Why I asked this is because when I convert it to a number by using num(create_time), it gives me a negative number. But your variable time_1530 is a positive number and that's why your formula does not work. If you can get the field create_time back to a normal time field, everything should work ok.


Herman

View solution in original post

15 Replies
Not applicable

Try changing the simple quotations ( ' ) with double quotations ( " ). Sometimes it only works this way

laujerry
Creator
Creator
Author

thanks for your prompt response, but it does not work too

Not applicable

Change the "time_1530" SET variable from Time#('15:30') to Time('15:30').

PFA

laujerry
Creator
Creator
Author

ur attachment works fine

but it just does not work for mine

Not applicable

So I think that the only possibility is that the [create_time] field is not properly created and QV cannot compare it to a time value. It would be helpful if you could post more information about how it's created in the script.

laujerry
Creator
Creator
Author

actually i hv such a suspicion before

but then i hv tested it with a text object

=if([create_time]<$(time_1530),'yes','no')  // with listbox selection of 1 value only

and it works fine, so i expect the create_time should be in proper data type

for your information, my data source is sap

i load the create_time field without any data type casting

Not applicable

I'm running out of ideas.... the last one I have, have you tried changing the SET variable for a LET variable?

laujerry
Creator
Creator
Author

i create the var in settings->variable directly

does it matter?

adnan_rafiq
Partner - Creator II
Partner - Creator II

try converting both these in number format. that is while loading user this in scripting  num(create_time) as create_time ,

while creating variable for time user which you are using in the set analysis again use num.

As you are using comparison of greater than or less than it might be an issue of comparing. Set analysis some times take it as text field rather than numeric