# Query with filter

**URL:** <https://forums.losant.com/t/query-with-filter/2625>\
**Category:** Help\
**Tags:** workflow\
**Created:** [February 10, 2020, 5:34pm UTC](https://forums.losant.com/t/query-with-filter/2625 "2020-02-10T17:34:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [February 10, 2020, 5:34pm UTC](https://forums.losant.com/t/query-with-filter/2625/1 "2020-02-10T17:34:45Z")

</div>

I have a times series value, lets call it X that varied between 0-100.  
If I wanted to calculate the average of X for the past hour, but only use values if they are above 5.  
Can that be done?

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [February 10, 2020, 5:47pm UTC](https://forums.losant.com/t/query-with-filter/2625/3 "2020-02-10T17:47:12Z")

</div>

@Lars_Andersson,

When you say “use values” what do you mean? Do you only want to display values above 5 in the Dashboard? Or you want to filter the list within a Workflow and use them within the Workflow Engine?

---

<div class="post-metadata">

**Author:** ![Lars\_Andersson](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@Lars\_Andersson](https://forums.losant.com/u/Lars_Andersson)\
**Post date:** [February 10, 2020, 6:06pm UTC](https://forums.losant.com/t/query-with-filter/2625/4 "2020-02-10T18:06:05Z")

</div>

Sorry, I didn’t explain very well.  
Within the workflow.  
Just want values above 5 to be the base for the average.

---

<div class="post-metadata">

**Author:** ![JuliaKempf](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/juliakempf/32/2446_2.png) [@JuliaKempf](https://forums.losant.com/u/JuliaKempf)\
**Post date:** [February 11, 2020, 3:46pm UTC](https://forums.losant.com/t/query-with-filter/2625/5 "2020-02-11T15:46:53Z")

</div>

Hi @Lars_Andersson,

This functionality is not currently available out-of-the-box within Losant. At the moment, you would need to use a workflow to request the data for the past hour. You would then use a Function Node to do the aggregation manually, ignoring values below 5. You could also use a Loop Node with a Conditional Node and a few Math Nodes, but the Function Node will likely prove simpler.

Please let me know if you have any further questions,  
Julia
