Grafana multivalue float histogram_quantile - grafana

Hi I'm forcing problem with histogram_quantile. If I'll set my variable to multi-value so I can repeat panels. Then I got error which says
parse error at char 21: unexpected character: '\'
My request is:
histogram_quantile($percentile, avg((rate(http_server_requests_seconds_bucket{instance=~"$server"}[1m]))) by (le, application))
$Percentile variable is initiated as custom with values as below and multi-value selected
0.9, 0.5, 0.99

The default format for variables escape the . with a backslash, so 0.5 becomes 0\.5.
To not escape ., you can use another format on the variable like this: ${percentile:raw}.
More information on format options here.

The histogram_quantile function requires a single floating point number as an input, and the multi-value feature of Grafana will produce something like 0\.9|0\.5|0\.99 which is not a floating point number. You will need to use multiple expressions for this.

Related

MapBox NumberFormat expected syntax

I'm struggling a lot with MapBox Studio
I need to format elevation and use the numberFormat function.
However, I didn't succeed to find the right syntax. The documentation is very poor.
So far I did try to do this:
number-format(elevation, {'locale':'fr'})
but it keep says syntax is not correct. Tried double quote, tried also to add.
I found this only information:
Converts the input number into a string representation using the
providing formatting rules. If set, the "code" argument specifies the
locale to use, as a BCP 47 language tag. If set, the currency
argument specifies an ISO 4217 code to use for currency-style
formatting. If set, the min-fraction-digits and max-fraction-digits
arguments specify the minimum and maximum number of fractional digits
to include.
The right syntax to use seems to be documented there : https://docs.mapbox.com/mapbox-gl-js/example/cluster-html/
For my need, the right way to do it was
[
'number-format',
['get', 'elevation'],
{ 'locale': 'fr' }
]

Kentico 9 form fields.. Is there a way to make a feild into a currency field only?

Have a form I am trying to build and even though I have a text box field that will work for users to enter a $ amount it would be nice to make it so that field only accepts numbers and keeps it in the $0.00 format. Seems like a simple thing but I cannot seem to find out how this would be done.
You need to specify the field as a decimal or double and define the precision (depending on what version you are using). The field should NOT be a text field but can use a textbox as the displaying control.
From an output standpoint, it will not automatically output $0.00, you have to format that based on the culture. There are several macros and functions within the API to do this.
Setup you control as followed
make the Data type a decimal number
in the Editing control settings click to show the Advanced section
in Filter set Type to Numbers and Custom
Add Valid characters your delimiter (, or .)
In the validation section add a rule for the minimum value to be 0.
The data type will enforce it to be a actual number.
You could also use as Validation a Regular expression setting something like:
^[$]?([0-9]{1,2})?,?([0-9]{3})?,?([0-9]{3})?(\.[0-9]{2})?[$]?$
which will allow a dollar sign prefix or suffix.

emacs orgmode table use the equal sign without starting a formula

I'm typing up a table with org mode, where the equal sign(=) if the first character in the cell and it want to start a formula. how do I get it to display the symbol without it being a formula, of a way to use formulas to display it. I get errors when I use single quotes, and I see the Unicode decimal value when using double quotes.
I have tried the following
='=+'
="=+"
they give
#ERROR
[61, 43]
Use an escaped entity, \equal{} and it should display as you wish. See the variable org-entities for others you can use.
I'm a bit late :D
There may be a better way, but you can try with :='(format "=+")
Source: https://emacs.stackexchange.com/questions/19183/can-i-use-formula-to-manipulate-text-in-org-mode-table
When I ran into this problem just now, I found that I was able to get around it by replacing the equals sign with some other similar-looking character. Two which come to mind are ꞊ ‘U+A78A MODIFIER LETTER SHORT EQUALS SIGN’ and ⹀ ‘U+2E40 DOUBLE HYPHEN’.

Progress 4GL: Formatting decimals through temp-table declaration

I'm trying to format decimal's to round to the nearest hundredth with a temp-table declaration similar to this.
DEFINE TEMP-TABLE foo
FIELD random-decimal AS DECIMAL FORMAT "->>>,>>>,>>>.99".
The end result is displayed on a report through which I'm using the following to output:
EXPORT STREAM sStream DELIMITER ',' foo.
This does not seem to work as I'm intending it to. I'm still receiving values like this: 0.000073.
Does anyone have any insight to what I'm doing wrong? I was unable to find anything for this specific case anyone online.
FORMAT has no impact on storage. It is only a "hint" for default display and input purposes.
What you want is the "decimals" field attribute:
DEFINE TEMP-TABLE foo
FIELD random-decimal AS DECIMAL decimals 2 FORMAT "->>>,>>>,>>>.99".
create foo.
random-decimal = 1.12345.
display random-decimal format ">.9999".

zip code + 4 mail merge treated like an arithmetic expression

I'm trying to do a simple mail merge in Word 2010 but when I insert an excel field that's supposed to represent a zip code from Connecticut (ie. 06880) I am having 2 problems:
the leading zero gets suppressed such as 06880 becoming 6880 instead. I know that I can at least toggle field code to make it so it works as {MERGEFIELD ZipCode # 00000} and that at least works.
but here's the real problem I can't seem to figure out:
A zip+4 field such as 06470-5530 gets treated like an arithmetic expression. 6470 - 5530 = 940 so by using above formula instead it becomes 00940 which is wrong.
Perhaps is there something in my excel spreadsheet or an option in Word that I need to set to make this properly work? Please advise, thanks.
See macropod's post in this conversation
As long as the ZIP codes are reaching Word (with or without "-" signs in the 5+4 format ZIPs, his field code should sort things out. However, if you are mixing text and numeric formats in your Excel column, there is a danger that the OLE DB provider or ODBC driver - if that is what you are using to get the data - will treat the column as numeric and return all the text values as 0.
Yes, Word sometimes treats text strings as numeric expressions as you have noticed. It will do that when you try to apply a numeric format, or when you try to do a calculation in an { = } field, when you sum table cell contents in an { = } field, or when Word decides to do a numeric comparison in (say) an { IF } field - in the latter case you can get Word to treat the expression as a string by surrounding the comparands by double-quotes.
in Excel, to force the string data type when entering data that looks like a number, a date, a fraction etc. but is not numeric (zip, phone number, etc.) simply type an apostrophe before the data.
=06470 will be interpreted as a the number 6470 but ='06470 will be the string "06470"
The simplest fix I've found is to save the Excel file as CSV. Word takes it all at face value then.