I am in the process of setting up a new cube. This cube is going to be very similar to a cube that exists except it will contain only data where the date is not in the past.
The current table has data that is past and present. 1 idea was to create a database view on this table and include any rows where the date was >= getdate() but I don't think you can select a database view when setting up a cube, is this right? Another option would be to create a new database table that includes only those records with a present or future date.
The final option would be to filter the current cube but I think I would prefer a fresh cube with only this data as it will be predominantly used by users in excel pivot tables so I want to avoid any filters/mdx if possible.
What would be the way of achieving this?
Thanks
You can most definitely add a view in your SSAS DSV. You can select views or tables in the object chooser dialog box. You can also write a named query. Many people advise that you should always use views in your DSV for your cube. It creates a layer between the cube and the physical tables.
Another approach is to use the existing cube as a source for a Power Pivot model and filter the dates in the data model in Excel and then provide that model/Excel file to your users.
Related
I have created 2 datasets that return data from a web service.
now I want to merge those two datasets in a single dataset, is it possible to create another dataset that contains those 2 merged ?
PS: you can also propose new solutions
Unfortunately SSRS doesn't offer that feature. One alternative is using the Lookup and LookupSet functions to use both datasets together in the report, but this is not efficient for large datasets. If the data doesn't need to be live, another option would be to create a procedure that caches the joined data in a table on a schedule and then use that table in the report. If those options aren't adequate, you may want to look at using a different reporting tool such as Excel (with web services and power query) or Tableau (if you have licenses).
I'm working on project that has data warehouse implemented. The fact table has datetime stored in the format:
2015-01-31 23:10:49.4020000
Date Dimension has the dates included in the following format:
2015-01-01 00:00:00.000
Time Dimension is storing the time in the following format:
23:10:49 AM
Now, I have to make analysis using Tableau software, for which I need to join the two dimensions with the Fact table. I'm trying to create custom sql for creating a join, unfortunately I'm not able to do so.
Can anyone share how should I join the fact table with both the dimensions?
You are essentially looking for combining multiple tables using either Join Or Data Blending.
In tableau, you can combine data that exists across multiple tables or files by creating joins. Using joins to combine tables allows you to analyze data that have a relationship with each other.
Complete articles depicting all these steps can be found here
Connect to data and create your data source according to the examples
in Connecting to Data Sources.
After you select the file, database, or schema, double-click or drag a table to the join area of the data source page.
Double-click or drag another table to the join area. The join dialog box opens.
Add one or more join conditions by selecting a field from one of the available tables used in the data source, a join operator, and a field from the added table. Inspect the join condition to make sure it reflects how you want to connect the tables.
For example, in a data source that has a table of order information and another for users information, you could join the two tables based on the Region field that exists in both tables. Select the type of join.
When finished, click the "x" icon to close the Join dialog box.
In your case, You should go for these joins instead of Data blending. This is because, Data Blending does not create row level joins and is not a way to add new dimensions or rows to your data.
Data blending should be used when you have related data in
multiple data sources that you want to analyze together in a single
view. For example, you may have Sales data collected in an Oracle
database and Sales Goal data in an Excel spreadsheet. To compare
actual sales to target sales, you can blend the data based on common
dimensions to get access to the Sales Goal measure.
You can refer this article for more details
I know it is recommended to build dimension using a view on source table because it allows to make changes to the dimension contents without opening the SSAS project. However, I cannot create a view in the source system.
How can I load only a subset of data into a dimension?
A named query can be used to filter out unnecessary dimension members. Conceptually it is similar to a database view and the source RDBMS will take care of data processing (e.g. filtering it), but it is defined in the SSAS project.
Open the data source view.
Right-click on the dimension source table and choose Replace Table / With New Named Query... from the context menu.
Add a WHERE clause to the query and make any other changes you need:
I need to create a database which allow for easy manual entry of data as well as linking to SQL databases I have access to. This is something I've been researching and trying to design by myself for a while now. Everytime I think I have a solution I begin to have doubts that this is the right direction. I would really REALLY appreciate your help/input.
My current workflow and nightmare.
I work in IT and I'm responsible for reporting for my own group but it has been and will continue to expand across many groups across the whole IT organization. Each group has their own reporting tool with some that can export data cleanly/consistently, others that have to input data manually and a few which I can access the SQL database directly but haven't yet.
To create a monthly report I have a master workbook with graphs that reference data in multiple data collection workbooks. In these data collection workbooks I have the raw data which either myself or the team/service owners inputs each month. From that raw data I may create a pivot table to get the data I want and then in each one of the collection workbooks I have a 'reference" tab. In this reference tab I have a formula that is a rolling 13 months in the first column which say goes from Jan 2013 to Jan 2014. The months are calculated by referencing a cell that has the current reporting month in it. So for this example its Jan 2014. When you change that cell to the next month say Feb 2014 it will roll that first column so that those same cells now go from Feb 2013 to Jan 2014. the columns to the right of this column reference either the data table directly or the pivot tables using vlookups() or getpivotdata() formulas that reference the month cell to the left and grabs data accordingly. Here is an example of a collection workbook.
As you can see this can be a very manual and tedious workflow with many points where this could be improved. One major issue is the fact that each team/group doesn't pull data from the same tool and doesn't serve it up in the right format. I sometimes have to write a vba script to take the raw data and add helper data like a column with the correctly formatted 02/01/2014 format so it works in pivot tables correctly instead of multiple entries with different days (ie. 02/05/2014 02/23/2014).
The end goal + where I want to be
I want to create a database where I can link SQL databases directly to it as well as making it easy for a team to manually input data by reading in a csv or xls file of data. The crux again is that I'm only one person and I want to offload as much as the data entry to each one of those teams/groups without making it a difficult task.
Using the master sheet to create a monthly report has some great results but I would like this to be a web accessible and dynamic dashboard. I'm a pretty good front end dev with knowledge of HTML, CSS+LESS and some JS+SQL knowledge. I will have support of a senior web developer if I can proceed with this project. I just need help in working out the data collection/storage/querying portion of this.
If you got this far thank you so much for reading about my problem. If I wasn't clear about something or you have more questions for me please feel free to ask.
THANKS!
You may want to take a look at SQL Server's linked servers, according to the documentation, you can link any database who have an OLE DB driver so you can run queries mixing SQL Server and other databases, so it may be worth your while to check this.
What is the best way to re-use reports on different tables / datasets?
I have a number of reports built in BIRT, which get their data from a flat (un-normalized) MySQL table, the data which in turn has been imported from an excel sheet.
In BIRT, I've constructed my query like this, such that I can change the field names and re-use the report:
SELECT * FROM
(SELECT index as "Index", name as "Name", param1 as "First Parameter" FROM mytable) t
However, then when I switch to a new client's data, I need to change the query to the new data source and this doesn't seem sustainable or anywhere near a good practice.
So... what is a good practice?
Is this a reporting issue, or a database-design issue?
Do I create a standard view that the report connects to?
If I have a standard view, do I create a different view with the same structure for each data table, or keep replacing the view with a reference to the correct data table each time I run the report?
What's annoying is the excel sheets keep changing - new columns are added, and different clients name their data differently. Even if I can standardize this, I'd store different client data in different tables... so would I need to create a different report for each client, or pass in the table name to the report?
There are two ways and the path you choose is really dictated by how much flexibility you have architecturally.
First, you are on the right track by renaming your selected columns to a common name since that name is what is used to bind the data to the control on the report. Have you considered a stored procedure to access the data? This removes the query from the report and allows you to set up the stored proc on any database to return the necessary columns. If you cannot off-load to a stored proc, you can always rely on altering the query text at run-time. Because BIRT reports are not compiled (they are XML) you can change the query based on parameters and have it executed for each run of the design. Look at the onCreate event for the Data Set and you can access this.queryText and do any dynamic string substitution you need via JavaScript. Hidden parameters are a good way to help alter/tune the query. If you build the Data Set correctly, the changing of the underlying data could be as easy as changing the Data Source and then re-associating the Data Set to the new Data Source (in the edit data set window). I have done this MANY times and it works well. If you are going down this route, I would add the Data Source(s), Data Set(s) and any controls that they provide data to a report library. With the library you can use the controls in many reports and maintain them in one spot. If you update the library, all the reports using the library get updated as well.
Alternatively, if you want to really commit to a fully re-usable strategy that allows you to build a library of reusable components you could check out the free Reusable Component Library at BIRT Exchange (Reusable Component Library). In my opinion this strategy would give you the re-use you are looking for but at the expense of maintainability. It is abstraction to the point of obfuscation. It requires totally generic names for columns and controls that make debugging very difficult. While it would not be my first choice (the option above would be) others have used it successfully so I thought I would include it here since it directly speaks to your question.