# Average Count of the Data

**URL:** <https://community.tulip.co/t/average-count-of-the-data/3842>\
**Category:** Support, Troubleshooting, & Help\
**Tags:** connectors, apps\
**Created:** [October 20, 2021, 11:43am UTC](https://community.tulip.co/t/average-count-of-the-data/3842 "2021-10-20T11:43:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![psp316r](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/psp316r/32/8497_2.png) [@psp316r](https://community.tulip.co/u/psp316r)\
**Post date:** [October 20, 2021, 11:43am UTC](https://community.tulip.co/t/average-count-of-the-data/3842/1 "2021-10-20T11:43:03Z")

</div>

Below is the pic of an Machine Activity Table, Start Time and End Time are stored here, based on this StartTime and EndTime, need to calculate the hourly avg count of another field.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/f/f4366df55ec030ec1af24f0326bde34efbaa02d4.png)

how can it be done ?  
is it possible to get the data from Machine Activity to the Tulip Tables ?

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [October 21, 2021, 8:16pm UTC](https://community.tulip.co/t/average-count-of-the-data/3842/2 "2021-10-21T20:16:54Z")

</div>

hello @psp316r, would you like this displayed on a Table Analysis?? if so, something like this could work well:

 ![Screen Shot 4](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/7/7e8b23d62ccaf8446c3db60d7e829eec80e2ad82.jpeg)  
where the following is the expression to group by Hour

> format\_date\_tz(date\_trunc(@End Time , ‘hour’), ‘MMMDD HH’, ‘EST’)

as you can see, the Average `Part Count` is being taken from the various States the Machine is in:

 ![Screen Shot 3](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/2/2b4441a3131761a5c2acc3b3311641c4f5711b7a.jpeg)

would this work as a solution for you?? let us know!!

---

<div class="post-metadata">

**Author:** ![Amit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/amit/32/968_2.png) [@Amit](https://community.tulip.co/u/Amit)\
**Post date:** [November 14, 2021, 2:41pm UTC](https://community.tulip.co/t/average-count-of-the-data/3842/3 "2021-11-14T14:41:32Z")

</div>

Hi there,  
I want to create a similar analytics that in the x shows bars per hour and in the y show average of an integer value exists in the same records,  
I tried to put this expression in the X : format\_date\_tz(date\_trunc\_tz(@tbl\_collect\_multivac\_data Current\_time , ‘hour’, ‘Jerusalem/Asia’), ‘HH’, ‘Jerusalem/Asia’)  
But didn’t get any result, can anyone help me with the correct expression ?

Kind regards,  
Amit Berku

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [November 15, 2021, 5:41pm UTC](https://community.tulip.co/t/average-count-of-the-data/3842/4 "2021-11-15T17:41:51Z")

</div>

hello @Amit, that expression looks correct to me.

just to help understand the root cause, what is the error message you’re seeing??

if you didn’t get bars, it could be that there aren’t any Records or Completions for the specified time. have you tried expanding Date Range to All Time (or a period of time that contains Completions/Records)??

---

<div class="post-metadata">

**Author:** ![Amit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/amit/32/968_2.png) [@Amit](https://community.tulip.co/u/Amit)\
**Post date:** [November 15, 2021, 5:57pm UTC](https://community.tulip.co/t/average-count-of-the-data/3842/5 "2021-11-15T17:57:18Z")

</div>

Hi Gio, I did try to expand date range to all time but no results. Is my expression with exact parameters, like the hour kind of expression value?

> ![](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/45/82_2.png "gio") | [gio](https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.tulip.co%2Fu%2Fgio&data=04%7C01%7Camit.berku%40soglowek.co.il%7C42c135bd5b0f42d5078108d9a8609e9f%7Ca064aa5c45ec45109868ccfffd8c0943%7C0%7C0%7C637725955200119060%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=or33o4mmMWI4%2Fd4msvqL0sPUkNRfixAmQiHfjh0KLu8%3D&reserved=0) Tulip Community Lead  
> November 15 |
> 
> - | - |

hello [@Amit](https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.tulip.co%2Fu%2Famit&data=04%7C01%7Camit.berku%40soglowek.co.il%7C42c135bd5b0f42d5078108d9a8609e9f%7Ca064aa5c45ec45109868ccfffd8c0943%7C0%7C0%7C637725955200129060%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=17gGVElnKSCoz0ZfqH49Urll7EHwxBbJw%2Ff8kGEeXrY%3D&reserved=0), that expression looks correct to me.

just to help understand the root cause, what is the error message you’re seeing??

if you didn’t get bars, it could be that there aren’t any Records or Completions for the specified time. have you tried expanding Date Range to All Time (or a period of time that contains Completions/Records)??

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [November 15, 2021, 6:01pm UTC](https://community.tulip.co/t/average-count-of-the-data/3842/6 "2021-11-15T18:01:52Z")

</div>

yes, it should be displaying the HH if there is data in the range. as you can see here, your formula seems to be correct (this is a machine Analysis, but works for Completion data and Table):

 ![Screen Shot 1](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/f/fcc661a58dc5ffce301c2615f11e2939fb0f2416.jpeg)

would it be possible for you to share a screenshot?? thanks!!

---

<div class="post-metadata">

**Author:** ![Amit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/amit/32/968_2.png) [@Amit](https://community.tulip.co/u/Amit)\
**Post date:** [November 17, 2021, 6:38am UTC](https://community.tulip.co/t/average-count-of-the-data/3842/7 "2021-11-17T06:38:33Z")

</div>

Hi @gio ,  
Thank you for your help, the problem was with the 3rd parameter of the function, time zone, I tried to write EST like in your formula and got the data, than I tried to write mine and nothing, I wrote it oposite, instead of Asia/Jerusalem I wrote Jerusalem/Asia, that was the only problem.

Regards,  
Amit Berku

---

<div class="post-metadata">

**Author:** ![Amit](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/amit/32/968_2.png) [@Amit](https://community.tulip.co/u/Amit)\
**Post date:** [November 17, 2021, 6:52am UTC](https://community.tulip.co/t/average-count-of-the-data/3842/8 "2021-11-17T06:52:33Z")

</div>

Hi @gio ,  
I have one small question, now I have this graph :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/c/c831d9076d33155104d5510413f6619745bd9107.png)  
Bellow the bars there is the word “expression” because the source of data came from an expression, how can I change this description to something that the users will understand ?  
How can I center the title of analytics ? How can I translate the meaning of Y axis ?

Kind Regards,  
Amit Berku

---

<div class="post-metadata">

**Author:** ![gio](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tulip.co/gio/32/82_2.png) [@gio](https://community.tulip.co/u/gio)\
**Post date:** [November 17, 2021, 8:14am UTC](https://community.tulip.co/t/average-count-of-the-data/3842/9 "2021-11-17T08:14:56Z")

</div>

great to hear you found the root cause!! here are some answers to your questions:

> [@Amit](#):
>
> how can I change this description to something that the users will understand ?

this can’t be done if you’re using customized Time format, you could use `Hour of Day` instead of `Expression` if you don’t need to format the display of Hour groupings.

 ![Screen Shot](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/8/8d68f4d86ba342efd22f730cac43a1dc729d5286.jpeg)

> [@Amit](#):
>
> How can I center the title of analytics ?

this unfortunately cannot be done currently, feel free to share in [Product suggestions - Tulip Community](https://community.tulip.co/c/product-suggestions/10) if you’d like. I will mention that if you embed the Analysis in an App, you can overlay text to display more detailed contextual information.

> [@Amit](#):
>
> How can I translate the meaning of Y axis

if you navigate to `Y Axis`, you can define the Label and Save the update:

 ![Screen Shot 1](https://us1.discourse-cdn.com/flex020/uploads/agilemfg/original/2X/3/3ae8f1e5622b95eae0ce2c3e1de02cfb8a343347.jpeg)

hope this helps, let us know if you have further questions!!
