Grafana alert always gives no_data - influxdb

I'm trying to set an alert in Grafana as soon as the value is outside the range 16 to 36. I'm using influxDB
I have a simple query (A):
SELECT "value" FROM "temp"
The graph is shown correctly.
My alert config looks like this:
WHEN last() OF query(A, 1s, now) IS OUTSIDE RANGE 16 TO 36
But if I evaluate the Test Rule, I always get the state no_data. What am I doing wrong?

Well.. 3 years later.. =)
I had this same problem. To fix this, go to your Influx server and type:
use <databasename>
show field keys
The command "show field keys" will return something like this:
name: table_name
fieldKey fieldType
-------- ---------
value string
The problem is the column fieldType need to be float and not string. In my case, I dropped the database and created it again. And I inserted as decimal.

Related

Google Sheets - Conditional Formatting - Validate if exits duplicate on a column based on part of the column

I have a google sheet with only one column:
client_id
1234 - Act
4523 - Tdf
1111 - XXX
1234 - Act12
Right now I have conditional formatting that turns the cells red color if a client_id with the same value already exists. My function for that is:
`=SUMPRODUCT(TRIM($A$8:$A$9999965)=TRIM(A8))>1`
However, my client requests a little change, right now he doesn't want to compare if the entire client_id value already exists but in the case of the Number part. So with my previous formula, the client 1234 will not appear as Red because the String is different and he needs to know that a client with the number 1234 already exists on the database.
I try with this formula:
=SUMPRODUCT(TRIM(LEFT($A$8:$A$9999971, SEARCH("-",TRIM($B$8))))=TRIM(LEFT($B$8, SEARCH("-",TRIM($B$8)))))>1
But it does not detect the red even when the same value is registered and I got the following error:
`Function SEARCH parameter 2 value should be non-empty.`
Does anyone know how I can get this?
Many thanks for your help
You could try with SPLIT or REGEXEXTRACT.
=SUMPRODUCT(INDEX(TRIM(SPLIT(A$8:A,"-")),,1)=INDEX(TRIM(SPLIT(A8,"-")),,1))>1
=SUMPRODUCT(REGEXEXTRACT(A$8:A,"\d+")=REGEXEXTRACT(A8,"\d+"))>1

google sheets (h)lookup last non-null value in specific column

I'm trying to populate a column with the last known price at the end of a batch of orders.
Please see an example attached.
I need the last price known from columns "price". Please note that there is not always value.
I tried something like this : =LOOKUP(B2:H2,"price",B3:H3<>"")
But it didn't really work.
(the nos 18 and 3 in column "I" are just examples. I need the green 3 results),thx.
Maybe try:
=INDEX(FILTER(B3:H3,B$2:H$2="price"),COUNTIFS(B$2:H$2,"price",B3:H3,"<>"))
If there could be empty gaps in your data, try this alternative:
=INDEX(A3:H3,MAX(COLUMN(A3:H3)*(A$2:H$2="price")*(A3:H3<>"")))

Zabbix Item Calculation (Memory)

I want to get the percentage of free Memory on my laptop.
I want to get that info through an item of type: "Calculated".
1. what is the correct syntax for doing that?
2. what am I supposed to put into the "key" parameter while creating the "calculated" item?
This is what i tried so far:
Formula: last(vm.memory.size[available]) / last(vm.memory.size[total])
OS: WIN 10
Zabbix: 3.2
For calculated items you come up with the key, using the allowed characters - it will only act as an identifier of the item.

Google Sheets LEFT and ISNUMBER - Starfleet HR

tl;dr - How can I pull the first two characters from a column and have a second column declare whether those characters are a numerical value (no text)?
sub-question: why doesn't IF(ISNUMBER(LEFT(C2,2)), "yes", "no") do what I just said?
--
I'm a Starfleet HR Officer, and our database is a MESS. For a while there, the Vulcans were running our Humanoid Resources, and now our officer and crew tracking numbers have been...VULCANED.
Starfleet Humanoid Resources Google Sheet
In that sample sheet, we have a Starfleet ID and a Vulcan High Command ID for each member of the bridge crew of the USS Enterprise (NCC-1701). That would be great, except that some of the Officers have both their SFID and their VHCID, and some have VHCID in both fields. I need to be able to flag one of the two kinds of IDs in the Starfleet ID column - the VHCID looks simpler.
I want to call something like IF(ISNUMBER(LEFT(C2,2)), "VHCID", "SFID"), since ALL the VHCIDs start with two digits. But, as you can see, the sheet throws an SFID for all the LEFT output, even though, when I pull the two digits out, they are clearly numbers in some cases.
Anyone boldly gone here before?
adding a +0 after the Left() method will try and convert the result in to a number.
=IF(ISNUMBER(LEFT(B2,2)+0),"VHCID","SFID")
Seems to give the expected results.
As the comment points out, both Google Sheets and Excel has a function to convert the string to a text, called Value(). I had no idea that function existed in Excel, so thank you for sharing. The formula using the Value() function would look something like:
=IF(ISNUMBER(VALUE(LEFT(B2,2))),"VHCID","SFID")
Answer to your edit:
The function Left() is expecting a string and returns a string. The function IsNumber() just checks to see if the input is a number. Since the Left() function returns a string, it will always evaluate to false in the IsNumber() function.
To get around that, you can add 0 to the Left() function, which will convert the string to a number automagically (basically it will try to force the string to be a numeric to handle the mathematical operation). If the result of the Left() function is something like "42", then adding 0 makes it 42, which resolves to 'true' in the IsNumber() function. If your Left() function results in "Text", then the conversion fails, "Text" + 0 = "Text" and the IsNumber() function resolves to false.
TLDR: "42" and 42 are completely different things, adding 0 (or using the Value() function) fixes that.

Formatting: Changing Column Headers for SqlPlus Query

I'm having trouble with two formatting issues that I would really appreciate help with:
1) The Days Open column is displaying the number of days properly, but the column name is being overwritten by my conversion command, and
2) I need the Order Date (OOpenDate) to be displayed in the "MM/DD/YYYY" format
Code:
column O_Num heading 'Order|Number' format a6
column OOpenDate heading 'Order|Date' format a10
column (sysdate-OrderOpenDate) heading 'Days|Open' format a4
select O_Num, OOpenDate, to_char(sysdate-OOpenDate, '999')
from Orders
where Status = 'Open';
What its currently displaying:
Order Order
Number Date TO_C
------ --------- ------
100 03-DEC-13 14
What I want it to display as:
Order Order Days
Number Date Open
------ --------- ------
100 12/03/2013 14
Thank you in advance!
The simplest approach would be to alias the "Days Open" column and apply the format mask to the alias
column days_open heading 'Days|Open' format a4;
select O_Num, OOpenDate, to_char(sysdate-OOpenDate, '999') days_open
from Orders
where Status = 'Open';
Otherwise, the column name in your column command would need to exactly match the expression in your SELECT statement (including the to_char, any spaces, etc.) That's possible but it generally makes things rather hard to maintain.

Resources