Esper EPL query for calculating price velocity in a moving window - velocity

I want an EPL query to calculate a moving window price velocity, and am having a hard time piecing correctly. The velocity would be calculated as price in last event in moving window minus price in first event in moving window, divided by length of window in seconds. Something along the the lines of:
select Bid from MarketData(instrument='XYZ').win:time(10)(=>(.last() - .first())/10)
any help in correcting the query is much appreciated

Related

Power BI Waterfall Chart Issue

Is there any way we can disable the change over period value in waterfall chart.
I am not able to view the total value. Its showing the difference between the total and previous year. But i want to see the total of current year.
Use one of the column charts instaed. That's what they are made for.

Calculating the average percentage of a bunch of figures in Excel?

Basically, I'm trying to calculate the total average outage hours of a worksheet I'm working with, however I'm trying to have it further broken down.
Here is a picture of the Excel Sheet:
Excel Calculations
(Not allowed to add embedded pictures yet :( - 10 reputation needed, sorry!)
Pretty much, I'm trying to calculate what the average up-time is for the month, by calculating the average downtime and then subtracting it from 100.00%
What I've got works, but I'm trying to workout whether the Outage Hours column can be scrapped, and the total can be calculated with perhaps just a larger formula.
Here is a link to the spreadsheet: https://www.dropbox.com/s/msowjndootd2hh2/Spreadsheet%20Calculations.xlsx?dl=0
Thanks in advance!
Just to clarify, you're looking for the result from the second column without having to include the second column, correct?
Since the second column is just the remaining difference (from 1.00) of the first column, then to get the result, all you have to do is take the remaining difference for the maximum overall to the total sum of the first column.
Meaning (assuming 12 months)...:
=12-SUM(B4:B15)
(Substitute 12 for however many months to be summed)
EDIT: OP is looking for =AVERAGE(B4:B15)

TOTAL in bar chart in qlikview

I have this graph chart bar in Qlikview, the expression is:
INTERV= Sum(Quantity)/Count(Number)
and we can see the total for the first period is: 3450.76, i want to manipulate the total so as to calculate the total for each segment: the first segment is A: 192.70. I did Sum(TOTAL<Segment> INTERV) but it doesn't work to have the total I obtain 0 .
Your help is very apprciated
Thank you
Are you looking for a total for each value? In this instance it would not be possible as Qlikview is removing the text that it cannot show as the sections are too small.
You can increase the chart size so the overall area is larger, remove the stacking option or I would suggest having a separate Table chart to display these values alongside your graph.
Here are the options that can configure the different totals
For each category within a month (as you have at the moment) you enable this option.
Whilst to only have the total per month, this is on the expression tab.

Tableau - Adding dimensions together to show overall revenue

I am very new to Tableau (first day user) and have been a long time Excel user. I am trying to fully understand the power of Tableau to eventually move away from Excel.
I have a question concerning dimensions and creating a calculated field.
My table has multiple categories and sub-categories. My goal is to display the total revenue and average order value per chosen sub-category (this seems easy enough).
I want to then take those sub-categories and show a combined sum of revenue and average of the average order value. I am stuck on trying to also combine these sub-categories to show a blended view.
Furthermore, the 2 sub-categories are weighted very differently. The average order value of 1 has a much heavier weight than the other and will definitely affect the AOV when combined. How do you also assign a weight to this combined total?
Any help will be much appreciated. I know this may be a rather simple solution but I am new to the program and am having difficulty finding this answer.
Tableau screen:
or
img1 http://postimg.org/image/dq5wqgnyl/
Best,
CR
Put sub categories in the rows column.
Put sum revenue in the text pill in the marks section
In the analysis tab on the top select column grand totals.
I'm unable to see your images,i hope this answers a apart of your question.

Speed up Running Total MDX calculated measure?

I'm using the follow mdx to keep a running total of the Period Balance measure in my cube:
SUM({[Due Date].[Date].CurrentMember.Level.Item(0):[Due Date].[Date].CurrentMember}, [Measures].[Period Balance])
It works great, however it's really slow as the amount of data displayed increases. I can't use a MTD or YTD because the users may be analyzing data that overlaps years. Any way I can speed this up?
Thanks in advance.
I take it you've seen this? http://sqlblog.com/blogs/mosha/archive/2006/11/17/performance-of-running-sum-calculations-in-sp2.aspx
Failing that, there is another sample which uses the technique of taking the parent's prior totals and the parent's current child from first sibling to current - So you'd sum the prior months and then this month's days - That'll only work if you have a date hierarchy though:
http://www.ssas-info.com/analysis-services-articles/62-design/367-inventory-management-calculations-in-sql-server-analysis-services-2005-by-richard-tkachuk
I think the pictures there explain it better, its the "Summing Increments" section.
Are you query-logging and doing usage-based aggregations?