Help With A Matrix Or Pivot Table?
Aug 20, 2007
I'm trying to create a table that is a combination of two tables, and the number of columns is dynamic. So I have 2 tables, Students and Assignments. I'd like to get a result with the students on the left and the assignments across the top. I'm not sure where to start, any help would be great. Thanks
View 2 Replies
ADVERTISEMENT
Mar 18, 2008
Hi I need to transform this table below
QRT qt_yr TA AVG_MA AVG_MP TMP
--- ----- --- ------ ------ ---
33Q076248.5957.5462
2 2Qo7 0 0.00 0.00 0
11Q0839620.9643.54396
44Q0744338.8356.51443
into this format.
A_YP 2Q07 3Q07 4Q07 1Q08
---- ---- ---- ---- ----
TA 0 62 396 443
AVG_MA 0 48.59 20.96 38.83
AVG_MP 0 57.54 43.54 56.51
TMP 0 62 396 443
Please help. Thanks.
View 1 Replies
View Related
Apr 24, 2015
I am trying to create a matrix report to work similar to a pivot table, where when a user clicks on the count, the details are displayed. When I add the action to open a sub-report, how do I pass in the parameter values for the group that was selected? meaning if in row group- I have company name, and column group I have job title, when the count gets clicked, i need to pass in the company name for the row that was clicked along with the column group. How can I proceed?
View 2 Replies
View Related
Jul 8, 2015
Is it possible to generate automatic refresh of excel 2013 table which displays some table of a power pivot model on file open?? I dont want to use pivottable (which supports this ...)
View 2 Replies
View Related
Sep 14, 2015
There seems like there must be a way, but I'm a bit new to power BI. Â I've easily created a pivot/matrix summary table with all the numbers I need except one.....Percent of Total.For example, my table looks like the table below. Â What do I need to do to add an additional row that calculates the Percent of Total? Â So in this example, I'm looking to calculate the values of 40% (40/100) and 60% (60/100).
 1     2
Total
Row 1 20
10 30
Row 2 15
20 35
Row 3 5
30 36
Total 40
60 100
% Total 40% 60%
View 4 Replies
View Related
May 19, 2006
Hi all,
In MyDatabase, I have a TABLE dbo.LabData created by the following SQLQuery.sql:
USE MyDatabase
GO
CREATE TABLE dbo.LabResults
(SampleID int PRIMARY KEY NOT NULL,
SampleName varchar(25) NOT NULL,
AnalyteName varchar(25) NOT NULL,
Concentration decimal(6.2) NULL)
GO
--Inserting data into a table
INSERT dbo.LabResults (SampleID, SampleName, AnalyteName, Concentration)
VALUES (1, 'MW2', 'Acetone', 1.00)
INSERT €¦ ) VALUES (2, 'MW2', 'Dichloroethene', 1.00)
INSERT €¦ ) VALUES (3, 'MW2', 'Trichloroethene', 20.00)
INSERT €¦ ) VALUES (4, 'MW2', 'Chloroform', 1.00)
INSERT €¦ ) VALUES (5, 'MW2', 'Methylene Chloride', 1.00)
INSERT €¦ ) VALUES (6, 'MW6S', 'Acetone', 1.00)
INSERT €¦ ) VALUES (7, 'MW6S', 'Dichloroethene', 1.00)
INSERT €¦ ) VALUES (8, 'MW6S', 'Trichloroethene', 1.00)
INSERT €¦ ) VALUES (9, 'MW6S', 'Chloroform', 1.00)
INSERT €¦ ) VALUES (10, 'MW6S', 'Methylene Chloride', 1.00)
INSERT €¦ ) VALUES (11, 'MW7', 'Acetone', 1.00)
INSERT €¦ ) VALUES (12, 'MW7', 'Dichloroethene', 1.00)
INSERT €¦ ) VALUES (13, 'MW7', 'Trichloroethene', 1.00)
INSERT €¦ ) VALUES (14, 'MW7', 'Chloroform', 1.00)
INSERT €¦ ) VALUES (15, 'MW7', 'Methylene Chloride', 1.00)
INSERT €¦ ) VALUES (16, 'TripBlank', 'Acetone', 1.00)
INSERT €¦ ) VALUES (17, 'TripBlank', 'Dichloroethene', 1.00)
INSERT €¦ ) VALUES (18, 'TripBlank', 'Trichloroethene', 1.00)
INSERT €¦ ) VALUES (19, 'TripBlank', 'Chloroform', 0.76)
INSERT €¦ ) VALUES (20, 'TripBlank', 'Methylene Chloride', 0.51)
GO
A desired Pivot Table is like:
MW2 MW6S MW7 TripBlank
Acetone 1.00 1.00 1.00 1.00
Dichloroethene 1.00 1.00 1.00 1.00
Trichloroethene 20.00 1.00 1.00 1.00
Chloroform 1.00 1.00 1.00 0.76
Methylene Chloride 1.00 1.00 1.00 0.51
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I write the following SQLQuery.sql code for creating a Pivot Table from the Table dbo.LabData by using the PIVOT operator:
USE MyDatabase
GO
USE TABLE dbo.LabData
GO
SELECT AnalyteName, [1] AS MW2, AS MW6S, [11] AS MW7, [16] AS TripBlank
FROM
(SELECT SampleName, AnalyteName, Concentration
FROM dbo.LabData) p
PIVOT
(
SUM (Concentration)
FOR AnalyteName IN ([1], , [11], [16])
) AS pvt
ORDER BY SampleName
GO
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I executed the above-mentioned code and I got the following error messages:
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'TABLE'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'AnalyteName'.
I do not know what is wrong in the code statements of my SQLQuery.sql. Please help and advise me how to make it right and work for me.
Thanks in advance,
Scott Chang
View 6 Replies
View Related
Oct 13, 2015
Can I force the following measure to be visible for all rows in a pivot table?
Sales Special Visibility:=IF(
  HASONEVALUE(dimSalesCompanies[SalesCompany])
  ;IF(
    VALUES(dimSalesCompanies[SalesCompany]) = "Sales"
    ;CALCULATE([Sales];ALL(dimSalesCompanies[SalesCompany]))
    ;[Sales]
  )
  ;BLANK()
)
FYI, I also have other measures as well in the pivot table that I don't want to affect.
View 3 Replies
View Related
Oct 14, 2015
I have a simple pivot table (screenshot below) that has two variables on it: one for entry year and another for 6 month time intervals. I have very simple DAX functions that count rows to determine the population N (denominator), the number of records in the time intervals (numerator) and the simple percent of those two numbers.
The problem that I am having is that the function for the population N is not overriding the time interval on the pivot table when I use an ALL function to do so. I use ALL in other very simple pivot tables to do the same thing and it works fine.
The formula for all three are below, but the one that is the issue is the population N formula. Why ALL would not work, any other way to override the time period variable on the pivot table.
Population N (denominator):
=CALCULATE(COUNTROWS(analyticJudConsist),ALL(analyticJudConsist[CurrentTimeInCare1]))
Records in time interval (numerator):
=COUNTROWS(analyticJudConsist)
Percent:
=[countrows]/[denominatorCare]
View 13 Replies
View Related
Aug 17, 2015
How can I apply "Min" formula under a "new measure" (calculated field) within a pivot table under Power pivot 2010?Can see that neither does it allow me to apply "min" formula directly "formula box" nor could find any other option.Intent formula: "=Min(1,sum(a:b))" this isn't allowed so all I can do is "=sum(a:b)".
View 3 Replies
View Related
Mar 11, 2015
I have simple pivot table (below screenshot with info redacted) that displays a population number ("N" below), this is the denominator, a cumulative numerator number (below "#") and a simple cumulative percent that just divides the numerator by the denominator. It cumulates from top to bottom. The numerator and percent are cumulative using the below functions. There are two problems with the numerator and percent:
1. When there is not a number for the numerator, there is no value displayed for both the numerator and the percent..There should be a zero displayed for both values.
2. When there has been a prior number for the numerator and percent (for a prior month interval) but there is no number for the numerator in the current month interval, the prior month number and percent are not displayed in the current month interval--see the 3rd yellow line, this should display "3" and "16.7%" from the second yellow line.Here is the formula for the numerator:
=CALCULATE(count(s1Perm1[entity_id]),FILTER(ALL(s1Perm1[ExitMonthCategory]),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory])))
Here is the formula for the percent:
=(CALCULATE(countrows(s1Perm1),FILTER(ALL(s1Perm1[ExitMonthCategory]),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory]))))/(CALCULATE(COUNTROWS(s1Perm1),ALL(s1Perm1[Exit],s1Perm1[ExitMonthCategory])))
View 24 Replies
View Related
Sep 18, 2015
I have data in my Powerpivot window which was generated by a sql query. This data includes a field named 'Cost' and every row shows a value for 'Cost' greater than zero. The problem is that when I display this data in the pivot table all entries for Cost display as $0. At first I thought that maybe Cost was set to a bogus data type (such as 'text) but it is set to ''Decimal Number' so that's not the problem.Â
What is happening and how do I fix it so that my pivot table reflects the values for 'Cost'?
View 3 Replies
View Related
Nov 23, 2015
I have a data table that contains budget and actual data by month. Â I use the data to create a pivot that shows actual results next to budgeted results. Â I need a column that shows that variance between those columns. Â I think my issue is that the "Type" field contains actual and Budget. Â I sum on "Type". Â I can't seem to create a sum since those items are in the same field or am I missing something?
Table design
Month|Division|Subdivision|Type|Dept|Rate|Units|Amount
October|DC|Day|Budget|125|10.00|100|1000
October|DC|Day|Actual|125|10.00|110|1100
Output Design
DC
DAY
Actual
Budget
125 AvgOfRate
AvgOfRate
SumOfUnits
SumOfUnits
SumOfAmt
SumOfAmt
View 4 Replies
View Related
Oct 9, 2015
How to get a list of values to actually display in correct order in either a slicer or when on an axis on a pivot table?
I currently have the below list and have tried to add a preceding numeric (ex. "1. <=0") or preceding blank space, neither of which is visually great. Is there another way?
<= 0
1 - 6
7 - 12
13 - 18
19 - 24
25 - 30
31 - 36
37 - 42
43 - 48
49 - 54
55 - 60
61 - 66
67 - 72
73 - 78
79 - 84
85 - 90
91 - 96
97 - 102
> 102
View 8 Replies
View Related
Apr 13, 2015
I am using excel 2010 and creating pivot table from Power Pivot. I created a pivot table with department slicers. All is good, the problem I am having is whilst in an unfiltered position (ALL) of the slicers (departments) I get 200 pages, now when I click on a given department with say 10 pages, I still get the same 200 pages with the first 10 pages showing the data from the clicked department and 190 blank pages.
All I want is to get a WYSIWYG (What you see is what you get) of what is on the screen as my print, but I am getting extra blank pages right after the data. Â How do I resolve this.
Below are the steps I go thru to printÂ
1. Select slicers in unfiltered position (ALL)
2. Select entire pivot table
3. Select Page layout and select print area.
4. Save
5. Click on Print Preview to preview the print
6. Click on a given department in the slicer and repeat item 5, but this gives me blank pages after the data.
Do I need any other step?Â
View 2 Replies
View Related
Apr 29, 2015
I have a pivot table that connects to our data warehouse via a PowerPivot connection. Â The data contains a bunch of comment fields that are each between 250 and 500 characters. Â I've set the columns in this pivot table to have the 'Wrap Text' set to true so that the user experience is better, and they can view these comment fields more clearly.
However, whenever I refresh the data, the text wrapping un-sets itself. Â Interestingly, the 'Wrap Text' setting is still enabled, but I have to go and click it, then click it again to actually wrap the text. Â This is very burdensome on the user, and degrading the experience.
Any way to make this text wrapping stick so that I don't have to re-set it every time I refresh the data?
View 2 Replies
View Related
Jul 19, 2012
I don't know if it's a local issue but I can't use temp table or table variable in a PP query (so not in a stored procedure).
Environment: W7 enterprise desktop 32 + Office 2012 32 + PowerPivot 2012 32
Simple example:
   declare @tTable(col1 int)
   insert into @tTable(col1) values (1)
   select * from @tTable
Works perfectly in SQL Server Management Studio and the database connection is OK to as I may generate PP table using complex (or simple) queries without difficulty.
But when trying to get this same result in a PP table I get an error, idem when replacing table variable by a temporary table.
Message: OLE DB or ODBC error. .... The current operation was cancelled because another operation the the transaction failed.
View 11 Replies
View Related
Sep 17, 2015
I cannot create a measure that returns results for dates that do not exist in the fact table despite the fact that the components included in the measure contain valid results for these same dates.Creature a measure that counts the number of days where the "stock qty" is below the "avg monthly sales qty for the last 12 months" (rolling measure).Here is the DAX code I have tried for the measure (note that filter explicitly refers to the date table (called Calendar) and not the fact table):
StkOutCnt:=CALCULATE (
COUNTROWS ( VALUES ( Calendar[DateKey] ) ),
FILTER (
Calendar,
[Stock qty] < [Avg Monthly Sales Qty L12M@SKU]
)
)
Below you can see the sub measures (circled in red) are giving results for all days in the calendar.Highlighted in yellow are dates for which the StkOutCnt measure is not returning a result. Having investigated these blank dates, I am pretty confident that they are dates for which there are no transactions in the fact table (weekends, public holidays etc...).why I am getting an "inner join" with my fact table dates despite the fact that this is not requested anywhere in the dax code and that the two sub measures are behaving normally?
View 6 Replies
View Related
Apr 10, 2006
Hi Friends,
I am working on a sport site, where i have to create a Calender Like
thing where i have to show which sport is avaible in which month,
we can have any numbers of sports as the club grow it can add 100s of
different sport to itself, so i was not able to understand how to make
a database for this kind of thing, can anyone please help
Games - Jan Feb Mar Apr May Jun Jul …..Dec
Cricket
Yes Yes
Yes No
No No
No .....
Hockey No
Yes Yes
No No
Yes Yes .....
Horse R
Yes No
No No
Yes Yes
Yes .....
Thanks in Advance
Regards
Viking
View 1 Replies
View Related
Jul 20, 2007
Is it possible to use table instead of a matrix to achieve similar functionality? Would that require creating a pivot table in SQL query?
View 14 Replies
View Related
Mar 15, 2008
SK Qty
%
SKU Qty
%
A
AA
Item 1
2
2/4
Item 2
1
1/4
Item 3
1
1/4
AA Total:
4
4/ 10
AB
Item 1
2
2/6
Item 4
3
1/6
Item 5
1
1/6
AB Total:
6
6/10
A Total:
10
10 / 25
B
BA
Item 6
2
Item 7
2
Item 9
3
BA Total:
6
BB
Item 10
2
Item 11
3
Item 13
4
BB Total:
9
B Total:
15
Total:
25
25/25
=======================================================================================
I have a matrix table above, a "%" value is needed to present in the "%" column. But i can't get those value in red color in every row accordingly.
Pls help and thanks so much in advance!
View 19 Replies
View Related
Apr 22, 1999
Perhaps I was dreaming, but I thought I remembered reading in some SQL Server 7 propaganda that PIVOT TABLE was added. The idea is, a cool syntax that would turn a number of rows into the same number of columns, and automatically transpose the values for you.
This is not a data-mining application. It's more a hyper-normalizing operation. We define products as a collection of attributes that are stored in rows, not columns. A single product is therefore one row from a Product Header table and N rows from the Product Attributes table. Products can have widely differing numbers of attributes.
I know you can write a query that will grab N rows and turn them into N columns, but I don't want to have to write one for every product type (meaning for N, O, P, Q, R and S attributes).
I just looked in one of my SQL Server 7 books and found nothing on Pivot Table, so maybe I was dreaming.
Failing this cool new command, do you know of a general solution to this type of problem?
Thanks in advance,
Arthur Fuller
View 1 Replies
View Related
Dec 24, 2013
I have to pivot one table to get the result in correct format. Here is an example as I am not sure how to explain it. If there is another way instead of pivot, let me know.
Table1
ID | Name |
1 | Joe |
2 | Ron |
Table2
Table1_ID | Language
1 | English
1 | ASL
2 | Spanish
2 | English
2 | French
I need the two tables joined and table2 to be pivoted to get the desired result as shown below. Third column for language is left off as I am limited to two columns.
Result
ID | Name | Language 1| Language 2
1 | Joe | English | ASL
2 | Ron | Spanish | English
View 5 Replies
View Related
Sep 8, 2006
I have read RobVolks article on creating a Pivot table. I have copied his code into a stored procedure. He then explains how to call this code see below. But how do I actually run the EXECUTE statement in my asp.net webpage ?
EXECUTE(crosstab) 'select title from titles inner join sales on (sales.title_id=titles.title_id)
group by title', 'sum(qty)','stor_id','stores'
http://www.sqlteam.com/item.asp?ItemID=2955
View 7 Replies
View Related
Feb 1, 2008
Hello All. I have a Pivot query that I am working on, and I have it working, however I want to add a 'totals' type column at the end. For some reason I can't get it to work
Here is my code
SELECT [July] AS July, [August] AS August,
[September] AS September, [October] AS October, [November] AS November, [December] AS December,
[January] AS January
FROM
(SELECT TimeStamp FROM tMaster WHERE ServicesArea = 'US') AS P
PIVOT
(Count(TimeStamp)
FOR TimeStamp IN
([July], [August], [September], [October], [November], [December], [January]))
AS Pvt
Any Thoughts?
Also, I was wondering if there was a way, I could add different calculations per row?
For instance, the first row would be counts per month of total # of good orders and the second row would be the total # of bad orders, the 3rd row being a total count of incomplete orders etc etc. Is there a way to do that?
View 4 Replies
View Related
Jun 12, 2007
I'm trying to extract some data from an ssas 2005 cube to build a report with ssrs 2005.
The report should have a variable number of columns and a fixed number of rows ... so I think I cannot use a table control but I must use a matrix control ...
So I would group the column for the fiscal month and the row for the measure name or measure caption ... and put the measure value inside the matrix.
Like the following
month 1
month 2
measure 1
xxx
xxx
measure 2
xxx
xxx
measure 3
xxx
xxx
To do that I should run a query to extract data in the following form ...
fiscal month
mesaure name
measure value
month 1
measure 1
xxx
month 1
measure 2
xxx
month 1
measure 3
xxx
month 2
measure 1
xxx
month 2
measure 2
xxx
month 2
measure 3
xxx
The problem is ... when running an mdx query on reporting services I need to put the meausure only on the columns ...
so any idea on how can I extract data from ssas in that form ??
Cosimo
View 1 Replies
View Related
Oct 31, 2007
I have the following table:
UserID Pet (Range: Cat, Dog, Fish)
------------------
1 Cat
1 Dog
1 Fish
2 Dog
3 Fish
......
I want the following result:
UserID(as PK) Cat Dog Fish
----------------------------------
1 Cat Dog Fish
2 (null) Dog (null)
3 (null) (null) Fish
.......
Does this have anything to do with pivoting table? How can I achieve this? Thank you.
View 3 Replies
View Related
Feb 3, 2004
I have a table defined as (int Row, int Column, money Data); as it were a matrix.
Which is the more efficient way of retrieving a result set with the following form?
Column1 Column2 Column3
---------- ----------- ----------
Data11 Data12 Data13
Data21 Data22 Data23
Data31 Data32 Data33
... ... ...
Thanks a lot in advance.
View 1 Replies
View Related
Apr 25, 2007
I have Report with subReport,
in the designer its looked well, but when I export the report to excell format
I get this error,
is it poosible export report with sub report to excell?
thanks!
View 33 Replies
View Related
Jul 19, 2007
I have a table and matrix placed next to each other in my report:
[Table displaying ProjectInfo, Revenue, etc.. ][Matrix displaying Monthly Distribution]
When I run the report, the result set returns say 100 rows for table and a row for each project in Matrix. The header and detail rows of table and matrix are perfectly aligned with each other, however, on the first page the table displays 47 rows and then breaks while the matrix displays 50 and breaks. On the next page the Matrix is three rows shorter. As a result the bottom of each control does not align on any page.
Any ideas what could be going wrong or how to fix this?
Thanks.
View 3 Replies
View Related
Dec 15, 2007
Hi everybody,
I'm having trouble creating a seemingly simple Comparison report.
I want to be able to create a Table or Matrix that displays the number of items for the Current Year, the Previous Year, and the Difference. I was able to write a script that gives me the count for each item, for each year, as illustrated below:
Item
WhichYear
Count
Apples
Current Year
2
Apples
Previous Year
2
Mangos
Current Year
214
Mangos
Previous Year
204
Oranges
Current Year
13
Oranges
Previous Year
20
Pears
Current Year
19
Pears
Previous Year
50
Strawberries
Current Year
28
Strawberries
Previous Year
40
Ideally, the report Layout look like this, with a column for each year, and a separate column for the difference:
Item
Current
Previous
Difference
Apples
2
2
0
Mangos
214
204
10
Oranges
13
20
-7
Pears
19
50
-31
Strawberries
28
40
-12
Sounds simple enough to me. But when I put it in a Table, I can't get the counts for the Current and Previous Years on one line per item. They end up broken down into two lines (as illustrated in the first chart). When I try to add a grouping, it somehow holds onto the Current Year numbers and ignores the Previous Year numbers. When I put it in a Matrix, I can't seem to write a simple calculation, like finding the Difference between the two columns. Can I add a non-pivot row or column to the matrix?
I know this is a very general question... Any idea on whether I should go for a Table or a Matrix or another approach, like a summary table?
Thank you very much in advance,
- Trevor
View 2 Replies
View Related
Feb 25, 2008
Hi,I have following data,India 91USA 01UK 44Like this, I have 100 Records (Rows) with 2 Column DataNow I want to have report like belowIndia 91 USA 01 UK 44Pakistan 92 .....How can I do this?Nilesh
View 4 Replies
View Related
Mar 27, 2008
Hi,
I create a matrix table with wizard. I want to write rownumber() as a new column near my column.
But when =Rownumber(nothing) it returns the value of the record in the dataset. If the data in the 56.row then
=Rownumber(nothing) =56
But in the preview of table it is in 1.row.
What can I do?
View 9 Replies
View Related
Jul 17, 2007
I am creating a report that uses the Matrix control. I need to display a fixed number of columns (5). In my query, I am returning the top 5 rows of data. However, in some cases there are less than 5 rows of data returned from the dataset. Is there a way to force the number of columns displayed in the matrix control and to populate with some text (such as "n/a") if no data is available?
Thanks!
ads
View 1 Replies
View Related