Format Date for a Dimension in Cube - formatting

I have a SQL Server Analysis Service OLAP cube where one of the dimension fields, is a datetime field. This is not a Date Dimension (Like the ones that can be generated.). This represents a month end period for the data. It can be filtered for example to see the end of year 2013.
The problem is the sql server data field is a datetime field, other than changing the type to just date, how can I change the format to exclude the time? Basically; MM/DD/YYYY.
Measures seem to have the ability to be formatted (Currency for example), but not Dimensions.
I looked at the view, but there's not formatting options their either. Maybe I need to look at the view code and add sql formatting code there?
Excel: I can't change the format on the cells in Excel either.

Try to format the Dimension Attribute field in your view first. Example:
FORMAT(hub.DateAlternateKey,'MM/dd/yyyy','en-US') AS DateAlternateKey
Then you should go under attribute properties of your Date Dimension's Day Attribute and set NameColumn=DateAlternateKey. This attribute should be set to Type=Date.

Related

Number of records shows correctly except column 'New Computed Start Date' shows all '######' format when date is pretty old date, example: 01-DEC-1184

In disco and ssrs Number of records shows correctly except column 'New Computed Start Date' shows all '######' format when date is pretty old date, example: 01-DEC-1184 but when export data from ssrs .
when export data from ssrs
data in ssrs before exporting
If you open an excel and input several dates in cells, any date before 01-01-1900 won't be parsed as date (if you set cell formatting to date for those cells). You can check this link for more details: http://www.exceluser.com/formulas/earlydates.htm
Same should apply for your data in the SSRS report.
I would format that column as text in SSRS instead as date.
Apply this 3 steps to display the date correctly and transfer it correctly to Excel:
Go to your general report settings and set the language (this value cant be empty)
Go to your textbox properties and set the Number format to Date
Go to your textbox expression and add a CDate() around your field =CDate(Fields!YourDate.Value)
This way the date gets displayed and exported correctly.

QlikView Dynamic Date Comparisons

I’m relatively new to Qlikview and have a dataset that shows metrics by date.
This data spans two years and the requirement is to have a comparison/variance that is dynamic and can handle the date filters on the report.
For example if the user selects 2018 this field should show the current date compared to the previous year date. Similar for Quarters, months, weeks and weekdays.
Ideally it should always show for the previous period. They’ve had this created in Excel but it can’t handle the amount of records and I suggested QlikView as I had created some other Dashboards in it.
I have tried set analysis though I struggle to see how that would fit into one expression.
Any thoughts would be appreciated!
I would say you would need two expressions, one without a set analysis (that would be filtered by your current selection) and one with a set analysis to guarantee that you only get today's value. This would be something like :
Sum($<[Date Field] = {"$(=Date(Today(), 'DD/MM/YYYY'))}>} [Value Field])
Check the date format conversion to see if it matches the date format of your field.

Changing a data format only for a year column in sql developer

I have a three tables in my database in every one of them is one 'DATE' format column, when I am changing data format through sql developer preferences It changes the format for the whole database but I want to show only year (YYYY) in the year column by default and other two with the preferences setting, is there any way to achieve that?
Formatting of a date should be done when you query it from the database or even better in the application that is using the data. You shouldn't be trying to control the way it is displayed by changing the database.

UltraWinGrid, on date filter select date column value changing format to MM/dd/yyyy from dd/MM/yyyy

I have infragistics2 v10.3.
I have ultra grid with two columns
|String|DateTime|
For DateTime I have custom formatting like "dd.MM.yyyy HH:mm" System Regional settings have short Date format like "dd-MMM-yy".
So grid shows 07.02.2013 14:00 and user See this.
The sytem have 07-Feb-13
When i want to filter all columns with text "fe" it is also shows me all rows which contains 07.02.2013.
During filtering it uses own formating and ignores my custom In InitializeLayout event we have done the following code to set date format for the StartDate column
e.Layout.Bands(0).Columns("StartDate").Style = Win.UltraWinGrid.ColumnStyle.Date
e.Layout.Bands(0).Columns("StartDate").Format = "dd/MM/yyyy"
e.Layout.Bands(0).Columns("StartDate").ButtonDisplayStyle = UltraWinGrid.ButtonDisplayStyle.Always
This date field column filter displaying based on Local system date format in opened calendar.
Please suggest me where I am doing wrong
As your are using string column type to store dates, I suspect how the dates are converted: 07/08/2015 is treated as August 7 or July 8?
You are setting the format for your grid but the data loaded in the DropDown may be in its original form as in the Database.
If you do not want to change the data type of your date column, I would advise that you set DateFormat within the select query as demonstrated in change-data-type-of-data-retrieved-by-select-query (but beware of the conversion errors or the date change scenario as pointed above)
If you are using SQL Server (I'm not sure about other databases) you can use a UDF (User Defined Function) in the select query as in this example of UDF on TechNet or this post on SO: using-udf-in-select-statement
Along with that don't forget to set the Format of your DropDown, if defined explicitly on initialize or on entering edit mode.
You need to set MaskInput property of the column like this:
e.Layout.Bands(0).Columns("StartDate").MaskInput = "dd/mm/yyyy";
Keep in mind when cell is in edit mode it uses an editor to display the edited value. So when you need to fix anything in edit mode you need to fix it in the editor.

Formatting measure based on dimension attribute

This may be very basic. I'm trying to change the format string used on a measure based on the attribute of a dimension connected to the measure. I'm doing this in a calculated measure at the moment.
Essentially, the fact table row contains a value for the ID of the dimension, and that dimension has the format information I want. I'd like to apply formatting based on that value, without the dimension being required in my query.
something like this:
WHEN [Format Source].[Hierarchy].CurrentMember.Properties("Format") is [Format Source].[Format].&[Number (123)]
THEN FORMAT([Measures].[Volume], "#.#")
I'd like this formatting to be applied regardless of having the dimension in the query, as I won't always have control over how the reports the users create. The data could be whole number or % with differing levels of decimal precision, based on the attribute of the format dimension.
I think that I may just be way off on this one, thanks in advance for any help