SSAS Date Field in None Date Dimension - date

I have issue trying to filter in excel 2010 pivot table on date attributes from a Cube source.
My problem is i have Date attributes in NONE date dimensions my example is a Asset Dimension that has a set of date attributes like:
Bought date
Sold Date
Repair Date
Is there a way to set these attributes to type date so pivot table will directly identify them and allow use of Date Filters ?
Or do i have to create a Date dimension for each attribute and user will have to select which Dimension he wants to slice data by

One option is to add an additional date "role-playing" dimension to the cube (e.g. DimAssetBoughtDate) and hang it off the fact tables using a reference-relationship through the Asset dimension. This not only provides you with the date-based filtering but also all of the built in hierarchies. Plus date dims are usually pretty small so materializing the relationship shouldn't be an issue.
Note: you may need to add a calculated member to your Asset dimension in your DSV to convert the date value (e.g. AssetBoughtDate 3/12/2015) to the date-key value (e.g. AssetBoughtDateKey 20150312) in order to properly add the new DimAssetBoughtDate.

Related

SSAS Tabular - No relation between fact table and 2nd Date dimension

I have 2 date fields in my fact table start_date and end_date.
Fact table is connected to the dim date with start_date.
I need to slice data by the second date field so I've created another date dimension similar to the first dim date and connected the key to the end_date in the fact table, but for some reason there's no relation between them when I browse the cube.
I made sure the keys are in the same format, data type etc.
The new dim date is 'marked as date table'.
What am I missing?
Thanks a lot.
Try with TabularEditor:
https://github.com/otykier/TabularEditor/releases/tag/2.13.0
open your Model and check relationships if you don't see the one you want, you can just add a new one.
You can also create multiple relationships to the same table using different columns (but as inactive), you can use this inactive relationship in calculation using USERELATIONSHIP.

Converting a measure to date for line chart in Tableau

I am trying to convert some measures that I have into dates for making a line chart. This is the data I have.
[
I am trying to make a line chart out of this data. But I cannot put it under a date since there are no dates in the dimensions. Any help would be appreciated.
You will need to some how reshape this data to create a single date field. You can do that out of Tableau or perhaps use Tableau prep. Your underlying data source is likely to drive that decision, you don't mention anything about that in your question.
Edit from comments:
Connect to the spreadsheet in Tableau. In the Data Source window, where it shows you all of the data in a table, select the 4 fields starting with Tuition and Fees. Then click on the drop down and Pivot those fields.
That will create 2 new fields, Pivot Field Names and Pivot Field Values.
In your workbook create 2 new calculated fields:
[FeeYear]: LEFT(RIGHT([Pivot Field Names],7),4)
and
[FeeDate]: MAKEDATE(INT([FeeYear]),1,1)
You can use FeeDate as the x axis of your line chart. Pivot Field Values is the measure to use in your line chart.

How to filter by current month automatically on pivot table google sheets?

As a data analyst, I would like to see the report in a pivot table automatically for the current month, so that I can take a look at it and don't have to change the date filter manually.
This is the formula to show the first day of the current month. (Which is the criteria I need, first of the current month)
=EOMONTH(today(),-1)+1
It works when I put this formula in any cell.
But when I put it in the pivot "filter by condition" option it doesn't work.
This is what I tried.
Text is exactly =EOMONTH(today(),-1)+1 (In formula box)
The date is exactly =EOMONTH(today(),-1)+1 (In formula box)
Here a screenshot of the options
Any help will be greatly appreciated.
I've never had great luck with the pivot table filter criteria in Sheets, I typically filter the data first if it's more advanced or use aggregating functions. In the Sheets pivot tables are better for quick analysis than dashboards.
There's probably a few ways to do it, but one of the easier ways would be to duplicate the data tab, clear the data and use a filter function to retrieve data. Update the Pivot table data source to the new tab. This will always only be the current month's data.
Basically you filter the data before the pivot table, with the [filter function][1].
=Filter(data , [date col]>=EOMONTH(today(),-1)+1 , [date col]< date(year(today()), month(today())+1,1)
You can also add a month column to the data and then filter on that column, however each month you would need to update the month filter in the pivot table.
=date(year([date cell]),Month([date cell]),1)
If you're using it for a 'dashboard' of sorts, I would generally recommend to create it yourself with aggregating formulas (sumifs, countifs, ect) and then you can use the more complex filters.
try custom formula:
=MONTH(A2)=MONTH(TODAY())
where A2 is first cell of column containing valid dates
You can try to Filter by a Custom Formula:
=month(DatePurchase)=month(TODAY())
Where DatePurchase is the Field Name.

PowerBi doesn't honour an SSAS OLAP cube date field

We have an SSAS OLAP cube, in production since long and perfectly tested by dozens of users, with a normal Time dimension (two hierarchies, Months and Weeks, but this is irrelevant).
The Time dimension key is a date field. On the data view it is defined as DataType: System.DataTime. On the dimension as Calendar -> Date, Usage: Key.
Using this date field on an Excel table accessing the OLAP cube is fully operational, it is a date and "Date filter" options are available as expected.
But trying to use this field on PowerBI defeated all our efforts! No way to have PowerBI interpret the field as a date, so no date filters are available. PowerBI thinks it's a text field and nothing we can think makes it change its behaviour.
We tested PowerBI with an external Excel and adding the SSAS OLAP dimension so to be able to modify the field format and oh surprise! the field is interpreted as text. Changing the format to date makes it work.
But there is no way to change the format for an SSAS OLAP cube when accessed directly as the primary (and only) source of data for the PowerBI repport.
Any idea how to define an SSAS OLAP date field so PowerBI understands it is a date?
Found it! One minute before getting mad forever I spotted the diference.
I was able to create two dimensions on the same cube, with the same field. One works, the other doesn't.
Define the date field as Order by Key and PowerBi treats it as a date.
Define the date field as Order by Name and PowerBi treats it as text.
I came across same situation. I don't know OP's calendar dimension properties, but his solution does not helped me.
In dimension design I used ValueColumn property
And in Power BI I saw a new field, that worked pretty nice with Slicer visual:
And Excel all remained the same:

drupal views difference between two dates

I want to create a view in which there are two fields start date and end date. I want to display one more field that is (difference between the start date and end date).
All this three fields should be displayed in table format.
So please tell me how to find difference between two dates using views?And i want to display this difference between the date fields as third column of the table.
You can try with Computed Fields. It allows you to define a new dynamic field for any content type (stored in database or computed on the fly), and you can code in PHP the value for this field, using other fields values.
Creating a computed field to store two dates fields difference is one of the example in the module doc :
https://www.drupal.org/node/149234
Then in your view you just have to display the computed field (and the two original fields).
Views PHP can do the trick as well, it allows you to create a new field within a view, which will be computed in PHP. You can use other fields values to calculate its value.
But I would recommend Computed Fields, Views PHP can be a performance killer.
Good luck