# How do I Improve Pipe lining Queries

**URL:** <https://discuss.elastic.co/t/how-do-i-improve-pipe-lining-queries/172059>\
**Category:** Kibana\
**Created:** [March 13, 2019, 5:18am UTC](https://discuss.elastic.co/t/how-do-i-improve-pipe-lining-queries/172059 "2019-03-13T05:18:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishnendu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krishnendu/32/48275_2.png) [@krishnendu](https://discuss.elastic.co/u/krishnendu)\
**Post date:** [March 13, 2019, 5:18am UTC](https://discuss.elastic.co/t/how-do-i-improve-pipe-lining-queries/172059/1 "2019-03-13T05:18:27Z")

</div>

I am very very new to pipeline querying. I am trying to create sprint velocity chart where velocity = Total story points completed/ total story points planned for the current sprint.

I have calculated both the numerator and denominator but not able to use them in inside |math divide (a,b) where a and b comes from two expression .

in my code 'a' :  
filters  
| esdocs index="index\_1\*" fields="fields.StoryPoints, key, fields.status.statusCategory.name.keyword, fields.Sprints.endDate"  
| filterrows fn={getCell "fields.status.statusCategory.name.keyword" | eq "Done"}  
| filterrows fn={getCell "fields.Sprints.endDate" | gte value="date"}"  
| math expression= "sum(fields.StoryPoints)"

and 'b' :  
filters  
| esdocs index="index\_1\*" fields="fields.StoryPoints, key, fields.status.statusCategory.name.keyword, fields.Sprints.endDate"  
| filterrows fn={getCell "fields.Sprints.endDate" | gte value="date"}"  
| math expression= "sum(fields.StoryPoints)"

--- Gauge Chart ----

filters  
| esdocs index="index\_1\*" fields="fields.StoryPoints, key, fields.status.statusCategory.name.keyword, fields.Sprints.endDate"  
| filterrows fn={getCell "fields.status.statusCategory.name.keyword" | eq "Done"}  
| filterrows fn={getCell "fields.Sprints.endDate" | gte value="date"}"  
| math expression= "sum(fields.StoryPoints)"  
| progress shape="horizontalPill"  
font={font size=24 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align="center"}  
max= {filters  
| esdocs index="index\_1\*" fields="fields.StoryPoints, key, fields.status.statusCategory.name.keyword, fields.Sprints.endDate"  
| filterrows fn={getCell "fields.Sprints.endDate" | gte value="date"}"  
| math expression= "sum(fields.StoryPoints)"  
}  
| render

Further can you please point to extensive examples and usage of piping . I have checked all from [https://www.elastic.co/guide/en/kibana/master/canvas-function-reference.html](https://www.elastic.co/guide/en/kibana/master/canvas-function-reference.html). What language it supports ?

Further I am also not able to perform group by operations, subqueries through pipelines. Can anyone help me on that as well please.

P.S : I wont be using ESSQL.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 10, 2019, 5:18am UTC](https://discuss.elastic.co/t/how-do-i-improve-pipe-lining-queries/172059/2 "2019-04-10T05:18:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
