How to fetch timenum() values

Hi all,
I am a learner of AFL. In the below code i am fetching volumes from particular time intervals.(from 9:15 AM to 10 AM)
But when i see the values in exploration window it is fetching for all the time intervals.Means every time the condition is true.Can any one let me know what is wrong in the condition.

tn= TimeNum();
Condition = 091500<=tn<=100000;
vol=ValueWhen(Condition,V,1);

Filter =1;
AddColumn(Vol,"volume",1.2);

volume1
Thanks in advance

tn= TimeNum();
session = 091500 <= tn AND tn <=100000;

Filter = session;
AddColumn(V, "volume",1.2);

You need to compare tn against starttime and endtime separately and then connect the two conditions via AND to define a session.

And that session variable (which returns true or false) is assigned to Filter (Filter outputs true results).

3 Likes
tn = TimeNum();
Condition = 91500 <= tn AND tn <= 100000;
vol= iif( Condition, V, 0);

Filter =1;
AddColumn(Vol,"volume",1.2);
1 Like