Configuring Azure Log Alerts using two columns from a summarized table - azure

I am trying to configure an alert in Azure that will send an email when a device has responded as "offline" 3 or more times in the last 15 minutes. The query I am using returns a summarized table with two columns, "Name" and "Count", where Count represents the number of offline responses.
Name
Count
ABC
4
DEF
3
My issue comes into play when trying to set up the conditions for the alert. Ideally I want to trigger an alert for any row where Count is greater than or equal to 3.
I can measure off of Table Rows or Count, but cannot seem to wrap my head around how to set up measurement and dimension splitting in a way that behaves similar to my goal I covered above. Thus far I have been able to set it up using Count, but it seems to only allow aggregating the values in Count, rather than looking at each row individually.
I have considered writing individual queries for each device that would return every offline response, and simply alerting off of the number of rows returned. I would much rather keep this contained to a single query. Thank you for any help you can provide.

Related

Referencing a cell in a query transformation to create a reverse running total

I have been working on this for several days now and am having no luck in figuring it out, but feel like I am very close.
In Excel, I am trying to create a reverse running total for a budget by referencing a cell which can be modified or updated.
The only way I have been able to make this work so far is by hard-wiring the starting amount in manually. this is what I want, except every time we receive money I have to change the starting amount manually again.
= Excel.CurrentWorkbook(){[Name="Q4Rec"]}[Content][QT4_Received]{0}
I used this to break down one of my input tables into queries that result in singular numeric values. (The table sums all of the revenue received into annual and quarter) How do I how to reference the new single-quantity queries in my previously built queries to conduct the transformation. I keep getting null values.

Excel Sheet: Count days a worker has worked

I work in Sales and I have to count how many days has a worker worked. I currently struggle to come up with formula to count it.
My thought proces is that I made a column with all the workers in the company and in second colum I want to get amount of days they worked. From data via Countifs I can pull TOTAL of entries there are with their name but I can't filter it with function to get specific amount of days they worked.
Example 1 of Data per one person if filtered manually:
Example 2 of Data per multiple workers:
As you can see our data is giving me multiple entries with one name, so like "Joe" has a certain date multiple times in the Data but I only need to count it once so I get the "1" that he worked in that day.
I don't want to mess with the original data input, I'm putting it ofcourse in different sheet since the Data sheet is just where I get my information from.
I used this formula to get total amount of entries from data per worker.
=COUNTIF(Data_All[Worker],[#Worker])
And then I tried to appoint it to a single date and make a whole table just for one worker and it would give me entries per day.
=COUNTIFS(Data_All[Worker],Sheet1!F2,Data_All[Datum],$H2)
Here as an example it showed like "Joe has 9 entries on that specific date"
So in the end what I'm looking for is a way or formula to be able to filter it and be able to count days a worker has worked from all the data given.
I also apologize if its difficult to understand what I'm looking for but my English is not that good and I'm pretty novice in Excel and its formulas.
Thank you anyway for any response to my issue.
Use Pivot table. Put Worker on "row", Date on "value", then right click on any date in Pivot table and choose "Summarize value by" and choose "count". Now you can see if any value is insert more then one time for any Worker. Then just Filer worker and count how many rows are inserted. Grand total is counted.

Excel Query looking up multiple values for the same name and presenting averages

Apologies if this has been asked before. I would be surprised if it hasn't but I am just not hitting the correct syntax to search and get the answer.
I have a table of raw data for my staff, it contains data on the name of the employee who completed a job and the start and finish times, among other things. I have no unique ID's other than name, and I cant change that as I'm part of a large organisation and I have to make do with the data I'm given.
what I would like to do it present a table (Table 2) that shows the name of the employee and then takes the start/finish times for all of their jobs on table 1 and presents the average time taken across all of their jobs.
I have used Vlookup in the past but I'm not sure it will cut it here. the raw data table contains approx 6000 jobs each month.
On table 1 i work out the time taken for each job with this formula;
=IF(V6>R6,V6-R6,24-R6+V6) (R= started Time) (V= Completed Time) in 24hr clock.
I have gone this route as some jobs are started before midnight and completed afterwards. Although my raw data also contains dates (started/completed) in separate columns so I am open to an experts feedback on this and if there is a better way to work out the total time form start to completion.
I believe the easiest way to tackle this would be with a Pivot Table. Calculate the time taken for each Name and Job combination in Table 1; create a pivot table with the Name in the Row Labels and the Time in the Values -- change the Time Values to be an average instead of a sum:
Alternatively, you could create a unique list of names, perhaps with Data > Remove Duplicates and then use an =AVERAGEIF formula:
Thanks this give me the thread to pull on, I have unique names as its the persons full name, but ill try pivot tables to hopefully make it a little more future proof for other things to be reports on later.

MutliGet or multiple Get operations when paging

I have a wide column family used as a 'timeline' index, where column names are timestamps. In order to prevent hotspots, I shard the CF by month so that each month has its own row in the CF.
I query the CF for a slice range between two dates and limit the number of columns returned based on the page's records per page, say to 10.
The problem is that if my date range spans several months, I get 10 columns returned from each row, even if there is 10 matching columns in the first row - thus satisfying my paging requirement.
I can see the logic in this, but it strikes me as a real inefficiency if I have to retrieve redundant records from potentially multiple nodes when I only need the first 10 matching columns regardless of how many rows they span.
So my question is, am I better off to do a single Get operation on the first row and then do another Get operation on the second row if my first call doesnt return 10 records and continue until I have the required no. of records (or hit the row limit), or just accept the redundancy and dump the unneeded records?
I would sample your queries and record how many rows you needed to fetch for each one in order to get your 10 results and build a histogram of those numbers. Then, based on the histogram, figure out how many rows you would need to fetch at once in order to complete, say, 90% of your lookups with only a single query to Cassandra. That's a good start, at least.
If you almost always need to fetch more than one row, consider splitting your timeline by larger chunks than a month. Or, if you want to take a more flexible approach, use different bucket sizes based on the traffic for each individual timeline: http://www.datastax.com/dev/blog/advanced-time-series-with-cassandra (see the "Variable Time Bucket Sizes" section).

What's a better counting algorithm for Azure Table Storage log data?

I'm using Windows Azure and venturing into Azure Table Storage for the first time in order to make my application scalable to high density traffic loads.
My goal is simple, log every incoming request against a set of parameters and for reporting count or sum the data from the log. In this I have come up with 2 options and I'd like to know what more experienced people think is the better option.
Option 1: Use Boolean Values and Count the "True" rows
Because each row is written once and never updated, store each count parameter as a bool and in the summation thread, pull the rows in a query and perform a count against each set of true values to get the totals for each parameter.
This would save space if there are a lot of parameters because I imagine Azure Tables store bool as a single bit value.
Option 2: Use Int Values and Sum the rows
Each row is written as above, but instead each parameter column is added as a value of 0 or 1. Summation would occur by querying all of the rows and using a Sum operation for each column. This would be quicker because Summation could happen in a single query, but am I losing something in storing 32 bit integers for a Boolean value?
I think at this point for query speed, Option 2 is best, but I want to ask out loud to get opinions on the storage and retrieval aspect because I don't know Azure Tables that well (and I'm hoping this helps other people down the road).
Table storage doesn't do aggregation server-side, so for both options, you'd end up pulling all the rows (with all their properties) locally and counting/summing. That makes them both equally terrible for performance. :-)
I think you're better off keeping a running total, instead of re-summing everything everytime. We talked about a few patterns for that on Cloud Cover Episode 43: http://channel9.msdn.com/Shows/Cloud+Cover/Cloud-Cover-Episode-43-Scalable-Counters-with-Windows-Azure

Resources