I have a pivot collection that has a numeric facet, however when the value is being displayed it keeps rounding to the nearest whole number.
Is there a way in which I can show the full number with the decimal places?
I am assuming that you are talking in CXML? If so, there is a Format attribute you can set on the facet category. It only works for DateTime and Numeric, but that will work in your case. The accepted format strings are .NET format strings.
Check here for full documentation of the PivotViewer CXML Schema
Related
I'm trying to match a string of numbers (like 370488004) using the typical INDEX MATCH formula. Unfortunately, in one range the numbers are formatted as plain text, and in the other range they are formatted differently. Usually 'Automatic' or 'Number'. I want to avoid having to update the formatting of both ranges whenever the values get updated (usually via a paste from an outside source). Especially since it's not always going to be me doing the updating.
Is there a way I can write my INDEX MATCH formula so that it ignores the formatting of the values it's attempting to match?
The value returned by the INDEX formula can be in any format. Plain text, number, doesn't matter. The problem is the two values I'm matching are in different formats. I need a formula that ignores that their formatting.
Here's an example sheet:
https://docs.google.com/spreadsheets/d/1cwO7HGtwR4mRnAqcjxqr1qbhGwJHLjBKkp7-iwzkOqY/edit?usp=sharing
You can use VALUE or INT to force it into a number value, or if you want to keep it text use TEXT. Example would be:
=INDEX(VALUE(D1:E4),MATCH(G1,E1:E4,FALSE),1)
The numbers in column D are in fact text, but utilizing VALUE first for the range puts them all in number format. It is finding the value associated with "Green" written in G1. Without seeing a working example sheet this is the best solution I can offer.
UPDATE:
You can use VLOOKUP array with a static range (otherwise error), or QUERY to have the range infinite.
=ARRAYFORMULA(VLOOKUP(VALUE($G3:$G5),$B3:$C,2,FALSE))
=QUERY(FILTER($B3:$C,$B3:$B=VALUE($G3:$G)),"Select Col2")
I have a column called internal_code in my Customer model. Since some users may use it as alphanumeric and others as only numeric, I need to suggest a number to the user before confirmation, in the UI.
I'm using this code right now:
previous_number = Company.where(:company_id => self.company_id).maximum(:internal_code)
But this is not working as expected, given for some reason, sometimes it's returning "999" when the latest value is "1000", or in another example "2290" when the latest value "2291".
I've been digging in the official documentation on maximum and calculate for Active Record, but didn't found if it's not intended to work with String columns. Maybe it's just obvious, but I wanted to ask here before I confirm my thoughts.
If this is a text column you may be getting the ASCIIabetical "max" instead of the numerical max. "999" sorts after "2291".
You need a numerical column type (e.g. INT) in order to do numerical maximums.
This should be a simple migration to change the column type if those values are purely numerical and fit in a 32-bit or 64-bit integer.
The definitive solution I found:
# Note: the ORDER clause is the KEY. Length means biggest number, ::bytea means sort it alphanumerically
filtered_result = Company.where.not(:internal_code => [nil,'']).where(:company_id => self.company_id).order("length(internal_code) DESC, internal_code::bytea DESC").first
previous_number = filtered_result.internal_code.scan(/\d{2,5}/).last
This complexity is given because of the possible values the users can put in this field. E.g.
"ABD123"
AS2134FG
AS34SD2342
Hope it helps in similar issues. Thanks all.
I am trying to create an appropriate Format table property of a specific MS Access table in order to achieve the display style described below. For example purposes, let the table name be example and the field that I am trying to format be dollars
When example!dollars.Value is 567.98, I wish to display $0.567K. I also wish to display 1,000.42 as $1.000K.
In another table storing larger values, I use the Format property string $#,##0,\K; ($#,##0,"K)"[Red];"| < $1K |"; --, which successfully displays the amount in K dollars; however, any values less than $1K cannot be displayed. This is not acceptable due to the scale of the values in the example table.
The most intuitive solution is to use the string $0,000\K and specify the thousands separator as . instead of ,. However, I do not know how to do this.
Any advice will be greatly appreciated!
This works for me:
Kamount = Format(Amount/1000, "$0.000K")
So divide by 1000, then format as needed.
Use the Format property string $0\.000\K
I'm trying to create a workflow that would make the target field value a negative number. I want to create related records as credits and debits and then be able to sum them up to get a net value.
I've tried to update the field to -1 and then multiply it accordingly, but I get an error stating that the value needs to be between 0 and 1,000,000,000,000. I've also just tried to multiply the value by a -1, but that doesn't work either. It just runs the workflow, but doesn't change the value.
Building on the comment from #MarioZG it looks like your CRM field doesn't allow negative numbers.
When you setup a number field (Decimal; Currency; Floating or Whole Number) you can specify the range of acceptable values. Here's a quick screenshot of the Whole Number's properties:
I actually figured this one out. I created two different workflows to create records in one entity with different "Types". Then, on the account I had a rollup field to sum one type and then a rollup type to sum the other type. Then I used a calculated field to subtract one from the other.
Use data type of the field as decimal number(looking at your use), in this case you will have flexibility of storing all sort of numbers.
I had a jqgrid with float numbers. I tried to get rid of the right side 0 and group the numbers, so those are now like (for example: "123,242"), and you know that the type of them are now String.
I want to sort theme like integer numbers in jqgrid.
what should I do?
for example a part of a column
after sort(asc) these strings are like
this:
1,959
1,965
1,989
10,235
100
100
...
Thanks in advance.
I believe you implemented the indexing and sorting according to jqGrid document. For example: http://www.trirand.net/forum/default.aspx?g=posts&t=254
I assume you retrieved data from database. If you’ve followed those already, moreover, you may need to CAST or CONVERT that particular database field from STRING or VARCHAR into INT or NUMERIC when you bind your SQL query.
jqGrid is powerful to do rest of things automatically.
You can zero-pad them (e.g. 00100 and 01959), sort them, and then remove the padding. Computer Programming 0101.