MDX query is reporting a unique row for each instance rather then rolling the data into one row where multiple column details apply - mdx

When I use the below MDX query on Azure Data factory Pipeline which is used to transfer data from SAP BW to Azure:
SELECT { [Measures].[00O2TN6100F25XV2PK2K7KLIP] } ON COLUMNS,
NON EMPTY { [ZBW_Country].[LEVEL01].MEMBERS, [ZBW_Province].[LEVEL01].MEMBERS, [ZBW_City].[LEVEL01].MEMBERS } ON ROWS
FROM ZCO_MP01/YCO_MP01_Q006_V2_RS1
WHERE [0CALYEAR].[2019]
My table looks like:
Country Province City Sales
Canada 13.12
ON 13.12
Toronto 13.12
So I tried redefining it to below query:
SELECT {[Measures].[00O2TN6100F25XV2PK2K7KLIP] }ON 0,
NON EMPTY CROSSJOIN(CROSSJOIN(DISTINCT([ZBW_Country].[LEVEL01].MEMBERS), DISTINCT([ZBW_Province].[LEVEL01].MEMBERS)), DISTINCT([ZBW_City].[LEVEL01].MEMBERS)) PROPERTIES MEMBER_CAPTION, [ZBW_MATNR].[2ZBW_MATNR] ON 1
FROM [ZCO_MP01/YCO_MP01]
This query works for me, it solves the issue and now I receive the data like this
Country Province City Sales
Canada ON Toronto 13.12
But when I bring in rest of the fields (I have almost 55 fields) then my Azure pipeline keeps on running and I cannot see it neither working nor aborting.
Can anyone please help me modifying this query to address the above issue without using cross join? I suspect my query is making the system very slow to process.
FYI: I'm new to MDX and I did enabled tracing on Microsoft Power Bi and then used the MDX query from its logs to draft the above query)

Related

How to join data in Google Sheet to Metabase to create dashboard?

My company uses the metabase for data analysis. The data I need to build the dashboard on the metabase is divided into 2, part of the data is retrieved from the SQL querying on the metabase and the other part is using google sheets as manual data. How can I join the data of the metabase and google sheet to create the dashboard on the metabase.
For example:
The data I need to build the dashboard on the metabase:
Name Age Adress Salary
Smith 25 Evans Mills $9000
The data is retrieved from the SQL querying on the metabase:
Name Age Adress
Smith 25 Evans Mills
Manual data on google sheets:
Salary
$9000
As far as my understanding of metabase, one of its limit is that it can not run queries across different databases.
However, I have helped our customer solve similar problems like yours. The software architecture is like this:
Metabase -> Presto SQL/Trino -> different database and different data source
In this design:
Metabase handles the dashboard part of work.
Trino handles the joining across different data sources.
Note: In our customer's case, the integration really requires certain programming work. It is not a quite trivial job.

Pull out specific word from description, but not limit entire query to that result?

I have a query where I am querying for a specific word in a ticket's short description, in this case WAP. So my current query looks like
Select * FROM table1 T
WHERE T.short_description Like '%WAP%'
The problem is that this entirely only shows rows if WAP is present in the short description, and I lose important grand totals. For example if I have 20 airlines but only 10 of those airlines have WAP its telling me I only have 10 total airlines which is not correct.
How can I rewrite this query to solve my issue, is this where sub queries come to play? I am a beginner at SQL.
To add additional context, I am looking to see how many total aircraft have had tickets created due to WAP issues. In this example if I get back 5 issues I want to be able to divide it by total airlines (but using Tableau not necessarily in the SQL statement) so 5/20 would give me what I want, however I am currently getting 5/10 (or the restricted set that the LIKE statement is limiting me to)
Thanks

Combine multiple database with different queries in 1 report ( bar chart)

I need to create a report using Pentaho User Console. I want to view my report in bar chart. In that report I need to include multiple query from different database and then the result in 1 chart. For example I have 3 database: Car, House, employee. I also have 3 query: quantity of car for each type, quantity of available house, total no of employee for each department. 3 different database and 3 different query but I want to show all 3 result in 1 chart. How I can do that?
You know about schema creation?
Go through on google how to create schema, what is fact table, what is dimension table..
And you can use pentaho schema workbench. It is used for your kind of purpose only.
and after creating schema in pentaho schema workbench you can publish that schema in pentaho BI server and you can view it in bar chart over their, and you can do analysis and drill-up , drill-down, slicing, dicing kinds of operations as well.
You can use kettle transformation as a data source for Pentaho report. Within the transformation it's perfectly fine to query 3 different DBs and prepare the result data set.

Business Objects (webi) stuck forever on retrieving data for specific dates

I am very new to BO webintelligence.
I am doing a very simple query, retrieve Sales Amount for dates between 2012 and 2013. Just for this simple query when I run it, my BO crashes or gets stuck on "please wait" window. Why is this happening? If I select like 3 or 4 days like between Jan 1st 2012 and Jan 4th 2012, it runs fine. Is there anything from my end that I am doing wrong? This is in production mode.
I also wanted to point out that I have tried limiting my data set for specific region etc.
Too many unknowns to successfully assist. I presume this is webi 3.1.x or 4.1.x and I presume that the Sales Amount is a measure and that your query includes a date which does not include a time component. If you only have these two objects in your results pane and have the region in your conditions then pulling something like [Date] and sum([Sales Amt]) should not take long to execute. As previous poster suggests, try to execute the sql in a tool like SQL*Developer or Management Studio or however the source database / OLAP is stored.
Even though you've limited the data to a "region" this may be too much data. Try selecting a smaller result set of 100 rows or changing the option for "retrieve duplicate rows" on the query panel.
If possible, post the query from your report using generic object names?

Sql Server Analysis Services 2008 Totals

I am using Sql Server Analysis Services 2008 to build a cube. I have the following scenario and was wondering if anyone had any ideas on how to accomplish it. The cube is displayed over the web using a third party tool(Active Analysis). There is role based security so the user only see's their data. I am trying to allow the user to see their data, and also a total of all the other data. For example, the user currently only has access to see the total population of Massachusetts, but should also see a row below it with the total population of all states.
Year
States 2009 2010 2011
MA 1,000,000.00 1,050,000.00 1,102,500.00
All States(?) 365,000,000.00 383,250,000.00 402,412,500.00
You can edit the role and on the Dimension Data tab, you probably have Enable Visual Totals selected which prevents the user from seeing the total of all states. When you clear the checkbox, the user still sees only MA but the total should be all states.
complementing Stacia's answer because it may be tricky to understand:
Visual Totals = true -> see only the totals permitted to the user
Visual Totals = false -> see the big total even though it may
restricted some part because of permissions