I have a requirement in which I need to display some decimal measures with a comma separator for decimal and not a dot and thousand separators as a dot and not a comma in SSAS. Example 2.245,89
This is a specific requirement for a dutch customer where they used to use this format for reporting purposes.
Any suggestions if this is possible in SSAS? If yes, how can I do this?
Thx!
You can assign the format as described https://dba.stackexchange.com/questions/132786/formatting-a-measure-in-ssas-cube
If you are using a calculated measure, you can use SSAS - How to configure format number for calculated measures?
Related
I have a database lookup step that is retrieving 3 fields from a SQL Server table. One of the fields is a decimal (8,6). When retrieved, the field values appear to be integers, losing all decimal places. I have spent several hours trying to resolve this issue and have found a reference to using an alter step to ensure the decimal places are available.
In the database lookup step I have tried different data types (number, string etc.) and I've followed this with a select values step, where I'm altering the field to a number field with decimal places. Nothing has worked, so any help with what I'm sure should be a simple problem to solve would be greatly appreciated. Apologies if the answer is obvious and I've missed it.
The Group By step has a similar issue when the Sum function is used, it uses a new mask that rounds up the number, thuough in the Group By case it is just a mask. I usually fix it using a Select Values step, altering the meta-data to Number, precision 2, format 0.00 and expliciting the decimal sign, like so:
Note that the decimal sign shown in the format does not alter the decimal sign to a dot, it's just a mask.
I am getting date like 20150910 numeric from backend.
I am creating new level in Dimension (in Mondrian-template)
Is there any way to format the date to 2015-09-10 ?
Can i achieve this using formatString ?
Any pointers will be highly appreciated .
Thanks
You can use a KeyExpression, which accepts SQL statements, then split the string in the various parts and concatenate it back with dashes in between.
See https://mondrian.pentaho.com/documentation/schema.php#XML_KeyExpression
Remark: if you use a KeyExpression you should not use a column attribute.
I want to store Comma(,) in Decimal(12,2) Datatype column at the place of Dot(.) in SQL Server 2014 but unable to achieve this.
I need the following behavior:
When i save decimal value 2.56 in database table then it automatically store this value as 2,56
What setting should i apply in SQL Server so that it will directly convert and save decimal Dot(.) to Comma(,)?
Is there any SQL Server Collation or Locale setting to save Comma in Decimal(12,2) datatype column?
SQL Server stores decimal values in an internal binary structure which does not include a decimal separator character. The separator used for displaying data is controlled entirely by the client application. Consequently, there is no SQL Server setting to control this.
Although you could convert the decimal value to a string containing the desired separator using T-SQL, the best practice is to do that in the presentation layer where you have more robust functions that can honor the client language and locale.
The SQL syntax uses Dot (.) as the decimal separator. You can't change that.
You are getting 2,56 because of your locale settings. All your queries should always use Dot (.)
If I'm understanding correctly, you don't care what SQL stores. What you want is to have comma instead of dot when querying the table.
If so: assume your column Average is of datatype decimal.
You can do this:
SELECT REPLACE(CAST(Average AS NVARCHAR), '.', ',')
FROM your_table
There is a problem in VBA text box while filling input mask property:
I am trying to make the combination of date and time:
Hence i put it like below:
00/00/00;0;_00:00;0;_
But while running the application, i am only getting 00/00/00 (Date).
But i remember, i got the result as like 00/00/00 00.00 as expected when i first put the expression as like above;
but now i am not getting it :-(
The InputMask property can contain up to three sections separated by semicolons (;)
Your mask should be like this:
"00/00/00 00:00;0;0"
or
"00/00/00 00:00;0;_" // to display it like __/__/__ __:__
Why not just use the built in "General Date" format? I've found over the years that input masks are very restricting and basically a pain. Although it's been so long since I've used them that I don't recall the details of why I despise them.
This also has the benefit of respecting the users choices of regional date format. For example I always use yyyy-mm-dd format.
Also a client had a situation where the date format was decreed to be Medium Date on all fields. Which is dd-mmm-yy. It later turned out that in a table of 100K records there were twelve dates before 1900. They had simple had something extra keyed in in the year so Windows/Access interpreted those dates as being in the 3rd or 5th century or whatever. Now these dates weren't used in any kind of calculation so it wasn't a big deal. SQL Server upsizing to small date/time fields didn't appreciate those though.
I'm working on a query which returns numeric values (currency). Some of the values are whole numbers and are being displayed as 3, 5, 2 etc whilst other numbers are coming up like 2.52, 4.50 etc.
How can I force oracle to always show the decimal places?
Thanks
TO_CHAR(pAmount, '9,999,999.99');
http://www.techonthenet.com/oracle/functions/to_char.php
http://www.ss64.com/orasyntax/to_char.html
To enhance the answers already given, you can use:
TO_CHAR(your_value,'fm999.99') to prevent leading spaces
____3.45 becomes 3.45 (_ indicates whitespace)
TO_CHAR(your_value,'fm990.99') to force values less than 1 to show a leading zero
.52 becomes 0.52
TO_CHAR(your_value,'fm990.00') to force 2 decimal places, even if 0
6.3 becomes 6.30
(TO_CHAR(your_value,'fm990.00')||'%') to add a percentage sign
18.6 becomes 18.60%
source: https://community.oracle.com/thread/968373?start=0&tstart=0
The display and formatting of the data should be handled at the presentation layer - not the data one.
Use the facilities provided by your front end to format the values as you see fit.
The to_char fixes the decimal issue but you have to be certain about the length. If it is longer than the format provided, it will show the number as ####. If the number is shorter, then it will leave spaces before the number. e.g
to_char(123.45),'99.00') will show ####
and
to_char(123.45),'999999.00') will show ' 123.45'.
So, if you have to export the results to CSV or Excel, these numbers will be treated as string.
So, I have not found any solution to it.
In SQL*Plus you can use the COLUMN directive to specify formatting on a per-column basis, separate from the query itself. That way you keep your query "clean" for possible other uses and still get your formatting. (In SQL*Plus at least...)
e.g
COLUMN SAL FORMAT 99,990.99
Google for "SQL*Plus User's Guide and Reference" and you should get links to the Oracle location for your Oracle version. 10.1 is here if that'll do. They'll probably all be about the same, mind you: I don't think SQL*Plus has changed much since I learned it in 1988 on Oracle 5.1.17...