I would like to know how to change the standard format for numbers in Power BI.
The software I use separates decimals by coma "000.000,00", but the idea is to set that to US format: "000,000.00".
How can I fix that?
There are two approaches to this problem.
If all the data sources you have in the current Power BI file are in the European format, you can set the locale of the file accordingly:
File -> Options and settings -> Options
Once set, Power BI can identify the format for numbers correctly when you change the data type in Query Editor.
If you're just catering for a particular data source, you can use the transformation Replace Values to swap . with ,, and then change the data type to decimal number afterwards.
Related
In PostgreSQL, I have a column with people's height in meters. If the height is, say 1.75 m, it shows properly, but if the height is 1.70 m, it shows as 1.7. I would like to have this already formatted to two decimal places, showing as 1.70 without formatting in each and every SQL call. Can I specify this in the table creation? Or a stored procedure, or something? I've seen a few things about timestamps, but not for real fields. Knowing how to format the decimal point as a colon (1,70) would be a plus.
Basically, presentation and "cosmetics" are the job of the application, not the database.
Having a default number of decimal places for floats would also create a problem, because the data returned by the database would not be the actual data in the column. So if you did a SELECT and it returned a value of 1.75, then if you searched for this value, you might not find it because the actual value stored was not 1.75 but 1.7499999999 and it was only rounded for display.
Potential solutions:
If you want to store a specified number of digits, use NUMERIC. This will solve the 1.7499999999 problem above. If you use NUMERIC, when doing a SELECT you get the actual contents of the column.
In your app, if you use an ORM, use a Decimal (or similar) type for the column with the appropriate settings so it displays the way you want.
Or create a view with the format applied to the column, but in this case if you want the trailing zero, the type will be text and not float, and it will not be searchable unless you create an extra index on it.
Generated column with the number formatted as you want, maybe easier than a view
I'm working on obiee 12c rpd. I have a measure column in my physical table in DB with bigint data type. In physical layer of rpd, I've chosen its data type as numeric because int data type is so small for my values. Because of numeric data type, it's added '.00' at the end of my values. I used to remove them with round function in BMM layer's expression builder but it didn't work. I tried this steps with Changing the numeric to double data type in physical layer but I got the same result means I see values with .00 at the end in my dashboards.
Now I'm going to remove these zeros in rpd.
Is it possible? How can I do it?
Thanks
I agree with the answers above. If that doesn't seem to work, you could try to change the format to custom and work with a mask as explained here: https://docs.oracle.com/cd/E29542_01/bi.1111/e10544/format.htm#BIEUG10831
From oracle doc:
JDBC and the Administration Tool do not support this type (BIG INT);
therefore, Oracle BI EE does not fully support the BIG INT type. BI
Server does offer some support for this type, but BIG INT has not
been thoroughly tested with Oracle BI Server. The BIG INT type is
intended to be same as the C int64 data type.
Link:https://docs.oracle.com/cd/E28280_01/bi.1111/e10540/data_types.htm#BIEMG4602
Making it DOUBLE and sort the .00 issue inside the answers solves your problem ?
Go to column properties and data format, here is the window:
That's not how OBI works. The RPD is the number crunching engine. NOT the visualization part.
If you want the decimals to be hidden by default, then you set the data format with zero decimals by default. That's how the tool works. Not in the RPD.
I'm trying to automate a process with SSIS that exports data into a flat file (.csv) that is then saved to a directory, where it will be scanned and imported by some accounting software. The software (unfortunately) only recognizes dates that are in MM/DD/YYYY fashion. I have tried every which way to cast or convert the data pulled from SQL to be in the MM/DD/YYYY, but somehow the data is always recognized as either a DT_Date or DT_dbDate data type in the flat file connection, and saved down as YYYY-MM-DD.
I've tried various combinations of data conversion, derived columns, and changing the properties of the flat file columns to string in hopes that I can at least use substring operations to get this formatted correctly, but it never fails to save down as YYYY-MM-DD. It is truly baffling. The preview in the OLE DB source will show the dates as "MM/DD/YYYY" but somehow it always changes to "YYYY-MM-DD" when it hits the flat file.
I've tried to look up solutions (for example, here: Stubborn column data type in SSIS flat flat file connection manager won't change. :() but with no luck. Amazingly if I merely open the file in Excel and save it, it will then show dates in a text editor as "MM/DD/YYYY", only adding more mystery to this Bermuda Triangle-esque caper.
If there are any tips, I would be very appreciative.
This is a date formatting issue.
In SQL and in SSIS, dates have one literal string format and that is YYYY-MM-DD. Ignore the way they appear to you in the data previewer and/or Excel. Dates are displayed to you based upon your Windows regional prefrences.
Above - unlike the US - folks in the UK will see all dates as DD/MM/YYYY. The way we are shown dates is NOT the way they are stored on disk. When you open in Excel it does this conversion as a favor. It's not until you SAVE that the dates are stored - as text - according to your regional preferences.
In order to get dates to always display the same way. We need to save them not as dates, but as strings of text. TO do this, we have to get the data out of a date column DT_DATE or DT_DBDATE and into a string column: DT_STR or DT_WSTR. Then, map this new string column into your csv file. Two ways to do this "date-to-string" conversion...
First, have SQL do it. Update your OLE DB Source query and add one more column...
SELECT
*,
CONVERT(VARCHAR(10), MyDateColumn, 101) AS MyFormattedDateColumn
FROM MyTable
The other way is let SSIS do it. Add a Derived Column component with the expression
SUBSTRING([MyDateColumn],6,2) + "/" + SUBSTRING([MyDateColumn],8,2) + "/" + SUBSTRING([MyDateColumn],1,4)
Map the string columns into your csv file, NOT the date columns. Hope this helps.
It's been a while but I just came across this today because I had the same issue and hope to be able to spare someone the trouble of figuring it out. What worked for me was adding a new field in the Derived Column transform rather than trying to change the existing field.
Edit
I can't comment on Troy Witthoeft's answer, but wanted to note that if you have a Date type input, you wouldn't be able to do SUBSTRING. Instead, you could use something like this:
(DT_WSTR,255)(MONTH([Visit Date])) + "/" + (DT_WSTR,255)(DAY([Visit Date])) + "/" + (DT_WSTR,255)(YEAR([Visit Date]))
I have a dataset containing a mixture of numerical and nominal attributes. I want to convert all the nominal attributes in the dataset to numeric so that I can apply the SVM classifier kernel(PolyKernel and RBFKernel) that only works with numeric attributes. Any help would be greatly appreciated. FYI I've already tried NominalToBinary Filter(Its not really what I want)
One thing you could do is convert all of the label names for the attribute using RenameNominalValues. Please note that all of these new labels would need to be numeric, so you might need to change them as below:
Once this is done, then you could save the .ARFF File, and change the entry in your attributes list from:
#attribute a0 {false,true,maybe}
to
#attribute a0 numeric
Once saved, reload the document and hopefully all will load okay.
Alternatively, you could try your favorite Spreadsheet Application if conversion of your data back to ARFF would not be an issue.
Hope this Helps!
There is no direct filter to convert nominal data to numeric data. If your nominal attribute has 2 values (SEX: MALE, FEMALE) you can easily apply the filter under unsupervised filters "nominal to binary".
But if you have more than 2 variations for the attribute, you cannot use "nominal to binary". So you need to use a filter called "Rename Nominal vales". There you can convert nominal value to numeric value.
Eg: if your dataset has an attribute called " region" and it has "INNER_CITY, TOWN, SUBURBAN, SUBURBAN" for values, you can easily convert those nominal values using the "Rename Nominal Value" filter.
There is a value replacement form, you have to do only add values like below. INNER_CITY:0, TOWN:1, SUBURBAN:2, SUBURBAN:3
you can see your results.
The NominalToNumeric filter (package: weka.filters.unsupervised.attribute) that is part of ADAMS allows you to do exactly that. You can either use the internal representation (i.e., order of labels starting at 0), or, if there is a numeric part in the label that can be turned into a number, use regular expressions to convert these sub-strings.
ADAMS also offers the Weka Investigator, a more powerful tool than the Weka Explorer. Just download the adams-ml-app-snapshot snapshot to get access to this filter.
Yes, you can convert nominal data to numeric in weka:
Example:
select: filters.unsupervised.attribute.OrdinalToNumeric
In my application, user select in which format they want the report. They enter one number which is format like 2000-1-4 and then they select CSV format and the data according to this number gets populated in that CSV.
Now the problem is when they enter this number which can be a date like 2012-1-4 then in CSV this number gets converted into 1/4/2012 which is wrong but when they give number like 883-17-8 then its coming as it is which is fine.
Is there any way i can resolve this? Someone please help me on this.
How the value is displayed depends on regional settings of operating system. (E.g. for windows 7 see Region and Language). In additional seetings there is also spcified CSV separator (List separator), etc..