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
Related
I am trying to display values of field "Contract Value" in millions as some stored values is 9 digit figures. For the convenience of users, I want display to these in million. This is very simple and common requirement for any application related to financial work. Please suggest easy solution for this.
I think you should do follwoing:
create custom field formatter example:
https://www.drupal.org/docs/creating-custom-modules/creating-custom-field-types-widgets-and-formatters/create-a-custom-field-formatter
and then you can write you own code
Write number conversion in above field formatter. example: How to show prices as million and thousands format?
Choose this field formatter in view.
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.
Parameter Value (It’s Unique Name) = [Company].[Company Hierarchy].&[10]
Parameter Label (It’s Name) = HQ
I want to type in “HQ” and generate report for “[Company].[Company Hierarchy].&[10]”
So, basically, I want to TYPE in label text and transform that somehow so ssrs would generate report for it’s value that matches MDX format [dim].[hierarchy].&[member]
It's kind of hard to explain but how would I go about setting up the parameter and how would I use that parameter for datasets?
Thank you
It is possible to use NameColumn in SSAS.
If you properly set up your Company dimension, you will be able to reach your dimension via its name and not via its key.
[Company].[Company Hierarchy].&[10] (that's the way you get the dimension with the key 10. The key 10 is unique, returning only one member)
[Company].[Company Hierarchy].[HQ] (that's the way you get the dimension with its name. [HQ] in this example might not be unique. Notice that I don't use & this time.)
I have one field when importing that can contain large data, it seems that CSV has unofficial limitation of about 65000 (likely 65535*) character. as both libreoffice calc and magento truncating the data for that particular field. I have investigated well and I'm certain it is not because of a special character or quotes. the data pretty straight forward, the lines are similar in format to each other.
Question: How to increase that size? or at least where I should look to find it?
Note: I counted in libreoffice writer and it was about 65040. but probably with carriage return characters it could reach 65535
I change:
1) in table catalog_category_entity_text
type of field "value" from "text" to "longtext"
2) in file app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
const DB_MAX_TEXT_LENGTH = 65536;
to
const DB_MAX_TEXT_LENGTH = 16777215;
and all OK
You are right, there is a limitation in Magento, because it sets texts fields as TEXT in MySQL database and, according to MySQL docs, this kind of field supports a maximum of 65535 chars.
http://dev.mysql.com/doc/refman/5.0/es/storage-requirements.html
So you could change the column type in your Magento database to use MEDIUMTEXT. I guess the correct place is in the catalog_product_entity_text table, where you should modify the 'value' field type to match your needs. But please, keep in mind this is dangerous. Make a full backup before trying. And you may even need to play with core files... not recommended!
I'm having the same issue with 8 products from a list of more than 400, and I think I'm not going to mess with Magento core and database, we can reduce the description strings for those few products.
The CSV could care less. Due to Microsoft Access allowing Memo fields which can contain quite a bit of data, I've exported 2-3k descriptions in CSV format to be imported into Magento quite successfully.
Your limitation is either because you are using a spreadsheet that has a cell limitation or export limitation on cells or because the field you are trying to import into has a maximum character limitation set in its table for that field.
You can determine the latter by using phpMyAdmin to see what the maximum character setting is for that field.
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.