Forum Discussion
Picking out select data from a large table
- Jun 17, 2020
Sam_S007 If you ar not into PowerQuery, perhaps you find the attached file useful. I inserted a few extra columns to create the chart data and a separate chart that looks like the one you provided. The selected data points are all that are closest to but not after, 20:45 on any given day.
Thanks!
Sam_S007 If you ar not into PowerQuery, perhaps you find the attached file useful. I inserted a few extra columns to create the chart data and a separate chart that looks like the one you provided. The selected data points are all that are closest to but not after, 20:45 on any given day.
- Sam_S007Jun 17, 2020Copper Contributor
Hi Riny_van_Eekelen,
This works and the chart is exactly what I'm looking for. Just wondering how you did it? How did you select only the rows at 20::45 UTC or closest for each day and how did you match them up with the corresponding rows for the price? I need to repeat this for another 100 stocks.
Also, would it be possible to remove the weekend rows entirely from the table? (So it's just Monday to Friday.)
Thanks!
Sam
- Riny_van_EekelenJun 17, 2020Platinum Contributor
Sam_S007 On the "popularity" tab, column C extracts the Time from column A. And the next extracts the Date. In E, I calculate the time for 20:45 minus the time value in C. Any positive value shows as hh:mm. However, when the Time is greater than 20:45 it becomes negative and displays as ########. In F, I check if the value on the next row in E is negative. That means that the time stamp is after 20:45. If so, then return 1, otherwise 0. In G, I find the User number if E is greater or equal to zero AND F equals 1. Thus, the nearest User value on or before 20:45. In H, I lookup the closing price for AAL for the date in D. #NA! means that there is no price, hence a week-end or public holiday.
The graph is then created on columns D, G (filtering out banks first) and H ("Connect data points with a line" so that you don't have to worry about deleting week-ends/holidays) with "Users" on the secondary axis.
All of this could be done with Power Query, and a chart based on the outcome. But it would take some learning, if you are not familiar with it. But the advantage would be that, once set-up correctly, you can use it for every consistently structured data set.
- Sam_S007Jun 17, 2020Copper Contributor
Hi Riny_van_Eekelen,
Would it be possible for you to build a template in Power Query (with a chart too) that I can then use for each of the 100 stocks that I need to analyze and chart? And would it be possible to remove the weekend rows as well? I'd be happy to pay via paypal for the template.
Thanks,
Sam