Row column group hiding in matrix report
Hi ,
I need to hide the repeated rows in matrix report,in below with red rounded (4%,4%) is coming twice for single resource.
I need to show only one 4% for this resource.How to do this in matric report.
thanks
bhupesh.r
those rows are not duplicates as far as SSRS is concerned as date values for them are different. So you need to change the logic at your backend query to return one out of these two records. Logic you alone can come up with as we dont know your business
rules, neither your tables and you've not posted anything barring a report screenshot.
Alternatively, if you want our help on this post your backend tables with some sample data and explain your rules for getting the required output.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
Similar Messages
-
Hello, Expert,
Could you please help me with the following problem? Thanks in advance!
I have designed the matrix report (SSRS 2012) with database table structure looks like below.
Week
Version
Count
Week1
V1.1
4000
Week1
V1.2
4000
Week1
V1.3
4000
Week2
V1.1
3000
Week2
V1.2
3000
Week2
V1.3
3000
Week3
V1.1
2000
Week3
V1.2
2000
Week3
V1.3
2000
Week4
V1.1
1000
Week4
V1.2
1000
Week4
V1.3
1000
The matrix report displays like below. Column grows based on no of Week in the table.
Week1
Week2
Week3
Week4
V1.1
4000
3000
2000
1000
V1.2
4000
3000
2000
1000
V1.3
4000
3000
2000
1000
What I want to do now is: instead of the Count values, I need to calculate the percentage of each week over the
Count in Week1 so that each cell displays Count(Week2)/Count(Week1), Count(Week3)/Count(Week1), etc. What is the SSRS expression for that? I’m new to SSRS, Please help!Heidi,
Thank you so much for your reply and solution! Now I know how to get the first field in a group. But I can't apply your solution directly just yet because in order to explain my problem I simplified my data structure. My real data structure has a nested
group like this:
Week VersionMajor VersionMinor Count
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Week1 V1 V1.1 2000
Week2 V1 V1.1 1500
Week3 V1 V1.1 800
Week1 V1 V1.2 1000
Week2 V1 V1.2 500
Week3 V1 V1.2 200
Here is the query for the above data:
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 2000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 1500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.1' AS VersionMinor, 800 AS Count
UNION ALL
SELECT 'Week1' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 1000 AS Count
UNION ALL
SELECT 'Week2' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 500 AS Count
UNION ALL
SELECT 'Week3' AS Week, 'V1' AS VersionMajor, 'V1.2' AS VersionMinor, 200 AS Count
And my matrix table looks like this:
What I need to do is to calculate the percentage of each week over week1 for
1) V1 Total
2) V1.1
3) V1.2
I can't use your solution directly because I need to apply Sum function for each cell and the Sum function gives me error when I try to use it on the denominator
First(Fields!Count.Value,"VersionMinor"). If you could help me further to get to the final solution, I'd really appreciate it!!
Happy New Year! -
Adding description column into wizard generated matrix report
Hi,
I currently have a matrix report that reports rows as job names and columns as media type. the intersection is the media code.
for example i have a job called abc and it has envelopes(e1,e2), base stationary (s1,s2) and inserts (i1,i2).
job envelope base stationary inserts
abc e1 s1 i1
e2 s2 i2
so far i have no problems. what i would like to do is add a description entry next to the inserts column. the description is only for the insert and only needs to be shown when an insert is present.
any ideas? i have tried adding in an additional field, however, i get some type of grouping error (my reports has just crashed so i can't get exact error)
thanks in advance for the help!Hi,
If I understood you right. Place the txt next to the insert field, then right click on the txt field and go to 'Conditional Formatting' then New. Put it in, if the value of Insert column is null, then click the 'Hide the Object' checkbox.
-Marilyn -
Multiple Rows for Same Value in Matrix Report
Hello
I am trying to create a matrix report that shows different page for each Category. Report looks like follows:
Page1( for Category '1')
Agent |
Calls |
Sales
TestAgent1 18
3
TestAgent1 5
1
Page2( for Category '2')
Agent |
Calls |
Sales
TestAgent1 26
5
TestAgent1 13
2
The issue is as you can see in above table, that i am getting repeated rows for same agents. I have tried making a parent group on Agent but it would still keep showing multiple rows. Ideally, it should show each agent only once in each page.
Any help would be appreciated.
PS: I am new to SSRS and this is my first time on microsoft blog, so i apologize if i wasn't able to follow the protocols/culture here.
ThanksHi M Adnan,
According to your description, you want to show a total Calls and total Sales for same agent so that it has only one row for each agent in your category group. Right?
In this scenario, if you only have a row group for category, it will show all “detail rows” in this groups even the agent of these rows are same one. So we can add a row group, set those detail rows group by agent and use Sum function to get the total Calls
and Sales. It looks like below:
If we want to display each Page in horizontal, we just need one Category column group for grouping rows and use sum function to get total Calls and Sales for each agent. It looks like below:
Reference:
Understanding Groups (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
-
hi
i have a matrix report with 2 level groups above it. now i need to sum group 2 cloumn values for every row on the basis of level 1 group.
For example, I have Top level group like TUBEWELL TYPE ( values are DEISEL and ELECTRIC) and below it at lower level is OWNER (with values like PRIVATE, GOVT) repeating both for DEISEL and ELECTRIC.
Now I need to sum every row i.e Private and Govt for Diesel and Private and Govt for Electric (two sums in one row).
Wizard provides complete row total but not group total.
So ur help required guys!!
nadeem ameer
[email protected]Hi..
am not providing you the exact answer.
But you can refer to the PRODUCT ORDER PROPERTY in the reports help or on the website.
Basically, all you need to do is manipulate the product order property, reset at or may be even compute at properties in the summary/ formula column of your matrix report.
Swati -
Column limit in SSRS Matrix report being uploaded to Report Manager in SQL2008 R2
Hi,
I am getting this error :
SQL Server Reporting Services
Error
The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible
version.
I am attempting to upload my SSRS Matrix report to Report Manager. The report has a lot of columns (109 row columns followed by the variable number of column columns).
After trial and error, I discovered that when I only have 107 row columns I can upload successfully.
Can anybody explain why this is happening? Is there a limit of 107 columns?
Thanks,
GRusteanAs there was too much nesting in the tablix inside the report. We added new tablix and shifted some rows to that tablix. Because maximum of 36 level nesting is allowed in tablix
-
Hi,
In the application, we have used a table (of type 'Advanced Table') and under that I require a column to get hidden in the table. When i navigate to see the columns through "Personalize" link corresponding to the table, I came to know the column i require to hide is represented in the form of column group. And under that column group, it has a sub-category of may columns present under it.
Will it be ok if i hide only the required column under that column group by setting the rendered property to 'false' or do i have to hide the entire column group itself ?
Suggestions needed....
With Thanks,
ThiyagarajanThanks All for your valuable responses...
In the same table, i am doing some calculations in the 'processFormRequest' method when the 'submit' button is clicked and the table has nearly more than 25 rows and it is listed as 10 rows per page.
Once the page gets loaded after the 'submit' button gets clicked, the page displays the table's last 10 records and not from the first 10. Is there any function can be used to point the records in the table in the ascending order instead of descending ?
With Thanks,
Thiyagarajan -
Forum FAQ: How do I achieve column break in a matrix?
Symptom
Although you can set page break for column group in Reporting Services 2008, page breaks are ignored on column groups. Reference:
http://msdn.microsoft.com/en-us/library/ms156434.aspx
Solution
Here are some workarounds, available forboth Reporting Services 2005 and2008:
Workaround 1
Spread the columns from one matrix into several matrixes. You can first copy one matrix and then paste it into several ones you want. Then set the filter for each column group to make sure that the total columns’ length in one matrix just fit a page’s width.
Workaround 2
The other method is to use a custom code.
a. Please copy the following code to the custom code area:
Dim FlagTable As System.Collections.Hashtable
Dim Flag AS Integer
Function MyFunc(ByVal NewValue As Object) As Integer
If (FlagTable Is Nothing) Then
FlagTable = New System.Collections.Hashtable
End If
If (NewValue Is Nothing) Then
NewValue = "-"
End If
If (Not FlagTable .Contains(NewValue )) Then
Flag =Flag + 1
FlagTable.Add(NewValue, nothing)
End If
MyFunc = Flag
End Function
b. Create a list in your report.
Imagine thatthe column group of a matrix is grouped bythe field ‘Column_Group’, then set the detail group of list withthe expression like this:
=Ceiling(Code.MyFunc(Fields!Column_Group.Value)/5)
Note: This means the Max number of column in matrix will be five after you follow step C.
c. Sort the dataset by column group field, and then drag the matrix into the list. Click Preview.
Workaround 3
Similar to the second method, you need to modify the dataset.
a. Create an ID column for the column group in your dataset.
For example,there isa datasetwith the following query:
SELECT * FROM Table
The column group is grouped on the field “Group1”.Then, modify the query like this:
SELECT *, Dense_Rank()OVER(order by Group1) AS ID FROM Table
b. Create a list in your report, set the detail group of the list with the Expression like this:
=Ceiling(Fields!ID.Value/5)
Note: This meansthat the Max number of column in matrix will be five after you followthe step C.
c. Sort the dataset bythe column group and then drag the matrix into the list. Click Preview.I have near about 30 matrics. so I need a paging. I did every thing as per this post and it really works for me.
I have total four columns. On one page it should show three and the remaining one will be moved to next page.
Problem occurs when in my first row i have 3 columns and in next page if I have one columns then it show proper on first page but on second page also it gives me three columns insted of one. the first column data is exactly what I have but in remaining two
columns it shows some garbage data.
I have data like below.
Metric ColumnNo RowNo
1 1
1
2 2
1
3 3
1
4 1
2
so while grouping i have a row parent group on RowNo and Column group on ColumnNo.
can anyone please advice on this. -
Calculate percentage between two rows in a matrix report with a single row group in SSRS 2008
I need your help. I have a matrix report in ssrs 2008. The report contain one field value column and one value column. I need to calculate a percentage for two values. For example : row 1 : Discount 10 Row 2 : Sales 100 Result : 10/100. I have only one
row group, I need to have a condition where Field = Discount % on Revenue then Discount/Total Turnover. Because of the grouping for total, I am not being able to calculate the %, its just totalling the % discount. Kindly refer to the snapshot of the
report.Hi Thanks a lot for your answer, but unfortunately it didn't work,the report is reading from a stored procedure which I have unpivot to convert all columns into rows, so that's why Discount % on Revenue, Discount and Total Turnover is found in one column.
So the Field!Col.Value is the Discount % on Revenue, Discount and Total Turnover. I have tried to change the code to
"=SUM(IIF(Fields!Col.Value = "Discount",Fields!value.Value),0))
/IIF(SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)) = 0 ,
Nothing,SUM(IIF(Fields!Col.Value = "Turnover Total",Fields!value.Value),0)))" but to no avail. Any other suggestion will be most welcome.
Thanks.
If everything you're getting from stored procedure then you need to calculate and bring the value from there itself.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Display null rows / columns in matrix report
Hi,
Is it possible to display any character ('0' for example) in a matrix report where the entire row or column show no value at all ?
My matrix shows Row1 and Row2 with values but no Row3 at all like this:
Column1 Column2 Column3
Row1 value1 value2 value3
Row2 value4 value5 value6
But I would like it to show my rows 3 with '0's :
Column1 Column2 Column3
Row1 value1 value2 value3
Row2 value4 value5 value6
Row3 0 0 0
Thank you,
DeniseMake your query return 0 with nvl(column, 0) and an outer join, plus some stuff to avoid a double outer join.
E.g. a sales per product per city:
City1 City2 City3
Prod1 10 100 12
Prod2 25 110 200
Prod3 0 0 0Could be made like this:
create table city (c_city varchar2(10));
create table prod (p_prod varchar2(10));
create table prod_sales (ps_city varchar2(10)
, ps_prod varchar2(10)
, ps_sales number);
<.....insert some values, except voor Prod3 .....>
SQL> select p_prod, c_city, nvl(ps_sales,0)
2 from (select c_city, p_prod from city, prod)
3 , prod_sales
4 where ps_city(+) = c_city
5 and ps_prod(+) = p_prod
6 order by 1,2 ;
P_PROD C_CITY NVL(PS_SALES,0)
Prod1 City1 10
Prod1 City2 100
Prod1 City3 12
Prod2 City1 25
Prod2 City2 110
Prod2 City3 200
Prod3 City1 0
Prod3 City2 0
Prod3 City3 0 -
Matrix Report Row Group Totals
dear experts,
I want to create a matrix report for purchase bills in which each bill may have mutiple items with diffrent rate and vat
i could create the matrix report but the grand total in each purchase master table having column billtotal, vattotal
the report shows one purchase row and vat column are displayed as multiple colums correctly
but grand total of billtotal, vattotal gets added as many times as the items are there in that each bill
any suggestion.
the data from various tables is attached as an xml and crude method i adopted to overcome the set repetation of masters
<PurchaseRrgister>
<y>
<doc_gl>500</doc_gl>
<doc_no>3</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>1835</supplier_billno>
<supplier_billdt>2012-03-31</supplier_billdt>
<amt>28641.6000</amt>
<z>
<suppliername>G.R.CORPORATION</suppliername>
<amount>28080.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>345.60</lstamt>
<w>
<vatname>C.S.T. 2%</vatname>
<syssrl>2</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>5</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>71</supplier_billno>
<supplier_billdt>2012-04-17</supplier_billdt>
<amt>30365.2700</amt>
<z>
<suppliername>GIRIRAJ TRADING COMPANY</suppliername>
<amount>28919.3000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>136.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
<z>
<suppliername>GIRIRAJ TRADING COMPANY</suppliername>
<amount>28919.3000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>750.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>3</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>8</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>2764</supplier_billno>
<supplier_billdt>2012-04-13</supplier_billdt>
<amt>14771.4000</amt>
<z>
<suppliername>FAVOURITE BOOK CLOTH & PAPER MART</suppliername>
<amount>13968.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>98.50</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>11</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>176</supplier_billno>
<supplier_billdt>2012-03-22</supplier_billdt>
<amt>61248.0000</amt>
<z>
<suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
<amount>61248.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>0.00</lstamt>
<w>
<vatname>TAX FREE PURCHASE</vatname>
<syssrl>2</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>13</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>178</supplier_billno>
<supplier_billdt>2012-03-24</supplier_billdt>
<amt>56448.0000</amt>
<z>
<suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
<amount>56448.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>0.00</lstamt>
<w>
<vatname>TAX FREE PURCHASE</vatname>
<syssrl>2</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>15</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>170</supplier_billno>
<supplier_billdt>2012-03-16</supplier_billdt>
<amt>58779.0000</amt>
<z>
<suppliername>VIGNESHWAR HOISERY MFG.</suppliername>
<amount>58779.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>0.00</lstamt>
<w>
<vatname>TAX FREE PURCHASE</vatname>
<syssrl>2</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
<w>
<vatname>TAX FREE PURCHASE</vatname>
<syssrl>3</syssrl>
<f>
<glname>CLOTH</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>21</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>13</supplier_billno>
<supplier_billdt>2012-04-05</supplier_billdt>
<amt>35280.0000</amt>
<z>
<suppliername>ROYALTY MINERALS</suppliername>
<amount>33600.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>520.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
<z>
<suppliername>ROYALTY MINERALS</suppliername>
<amount>33600.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>375.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>3</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
<z>
<suppliername>ROYALTY MINERALS</suppliername>
<amount>33600.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>275.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>4</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>22</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>14</supplier_billno>
<supplier_billdt>2012-04-03</supplier_billdt>
<amt>34102.5300</amt>
<z>
<suppliername>GIRIRAJ TRADING COMPANY</suppliername>
<amount>32478.6000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>1119.93</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
<z>
<suppliername>GIRIRAJ TRADING COMPANY</suppliername>
<amount>32478.6000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>204.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>3</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>29</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>2695</supplier_billno>
<supplier_billdt>2012-03-30</supplier_billdt>
<amt>52349.2200</amt>
<z>
<suppliername>VISHVARAJ ENTERPRISES</suppliername>
<amount>45200.8000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>1682.10</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>30</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>2694</supplier_billno>
<supplier_billdt>2012-03-30</supplier_billdt>
<amt>57675.4500</amt>
<z>
<suppliername>VISHVARAJ ENTERPRISES</suppliername>
<amount>49799.6000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>1544.20</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>43</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>2696</supplier_billno>
<supplier_billdt>2012-03-30</supplier_billdt>
<amt>46738.6500</amt>
<z>
<suppliername>VISHVARAJ ENTERPRISES</suppliername>
<amount>40300.3000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>1009.26</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
<z>
<suppliername>VISHVARAJ ENTERPRISES</suppliername>
<amount>40300.3000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>168.54</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>3</syssrl>
<f>
<glname>RAW MATERIAL</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>500</doc_gl>
<doc_no>58</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>44</supplier_billno>
<supplier_billdt>2012-04-11</supplier_billdt>
<amt>1820.2400</amt>
<z>
<suppliername>SAI ENTERPRISES</suppliername>
<amount>1440.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>73.74</lstamt>
<w>
<vatname>MVAT 12.5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>REPAIRS & MAINT - MACHINERY</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>501</doc_gl>
<doc_no>70</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>19601</supplier_billno>
<supplier_billdt>2012-04-23</supplier_billdt>
<amt>18678.9400</amt>
<z>
<suppliername>KISMAT MACHINARY SALES</suppliername>
<amount>16603.5000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>1214.81</lstamt>
<w>
<vatname>MVAT 12.5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>REPAIRS & MAINT - MACHINERY</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>501</doc_gl>
<doc_no>71</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>92</supplier_billno>
<supplier_billdt>2012-04-22</supplier_billdt>
<amt>5400.0000</amt>
<z>
<suppliername>AMIT TOOLS CO.</suppliername>
<amount>4800.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>237.50</lstamt>
<w>
<vatname>MVAT 12.5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>LABORATORY EXPENSES</glname>
</f>
</w>
</z>
</y>
<y>
<doc_gl>501</doc_gl>
<doc_no>75</doc_no>
<doc_dt>2012-04-29</doc_dt>
<supplier_billno>19832</supplier_billno>
<supplier_billdt>2012-04-27</supplier_billdt>
<amt>898.8000</amt>
<z>
<suppliername>STEEL TRADERS|</suppliername>
<amount>856.0000</amount>
<bed_amt>0.0000</bed_amt>
<ecess_amt>0.00</ecess_amt>
<vattotal>0.0000</vattotal>
<misc_charg>0.0000</misc_charg>
<prevatcharges>0.0000</prevatcharges>
<postvatcharges>0.00</postvatcharges>
<packingAmt>0.00</packingAmt>
<lstamt>14.00</lstamt>
<w>
<vatname>MVAT 5%</vatname>
<syssrl>2</syssrl>
<f>
<glname>CONSUMABLE STORES</glname>
</f>
</w>
</z>
</y>
</PurchaseRrgister>Hi Sushil Agarwal,
As per my understanding, you want to create a matrix and use xml as data source for purchase bills, each purchase bill has multiple items with different rate and vat. In order to improve the efficiency of troubleshooting, I need to ask several questions:
Please provide corresponding column name for purchase, rate, billtotal and vattotal.
“but grand total of billtotal, vattotal gets added as many times as the items are there in that each bill” What’s the meaning of this sentence?
What function do you want to achieve? What’s the state of report now? please provide some more detailed information of your requirements. I would be appreciated it if you could provide screenshot of the report in design mode.
This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
Thanks,
Wendy Fu
Wendy Fu
TechNet Community Support -
Matrix report in XML publisher with dynamic column groups
hi,
i have one matrix report in txt format having 5 columns under 1 month heading.
Now i want that all these 5 columns should repeat for multiple months depending upon input parameters.
S. No.
Organization Name
Organization Id
Project Code
1
GRANDWOODS 2
6825
1495
month
January
Wrk Count Ven
Wrk Cont Prw New
Wrk Amt Ven New
Wrk Amt Prw New
Tot Amt New
New
0
0
0
0
0
Existing
0
1
0
255000
255000
Total
0
1
0
255000
255000
rtf template is as follows:
S. No.
Organization Name
Organization Id
Project Code
F CS_11
ORGANIZATION_NAME
ORGANIZATION_ID
PROJECT_CODE E
month
Wrk Count Ven
Wrk Cont Prw New
Wrk Amt Ven New
Wrk Amt Prw New
Tot Amt New
New
F WRK_COUNT_VEN_NEW
WRK_CONT_PRW_NEW
WRK_AMT_VEN_NEW
WRK_AMT_PRW_NEW
TOT_AMT_NEW
Existing
F WRK_CONT_VEN_EXISTING
WRK_CONT_PRW_EXISING
WRK_AMT_VEN_EXISTING
WRK_AMT_PRW_EXISTING E
TOT_AMT_EXIS
Total
TOT_CONT_VEN_NEW_EXIS
TOT_CONT_PRW_NEW_EXIS
TOT_AMT_VEN_NEW_EXIS
TOT_AMT_PRW_NEW_EXIS
TOT E
E
now, please help me as to how repeat these 5 columns for multiple months.
if anybody has some template for matrix report with multiple coloumn group repeatation, pls. share along with sample data.
regards,
mohit guptaHi,
Check this link for developing the matrix report
Oracle Database and Oracle Applications: Matrix Report in XML Publisher
Regards
Srikkanth -
: HIDING SUMMARY COLUMNS IN MATRIX REPORT , URGENT
Hi,
Can any one please tell me how to hide a column in oralce matrix report. Its a summary column for the matrix report which appears next to the cell values. For example
Manufacturer
Brand
SubBrand1 SubBrand2 Brand Total Manufacturer Total
Week $ Sales $ Sales Total $ Sales Total $ Sales
This is a case where,the cell value is the $ sales for the SubBrand for the week. And it gets total at each brand level and each Manufacturer level. The requrement is if there is only one SubBrand for a Brand then the Brand total should not appear on the report. Similarly if there is one Brand for a Manufacturer, then the total at Manufacturer level should not appear . The point is not only it should dissapear but the frame should srink to make it fell that there is no totaling going on at those two levels. If the fileds just remains blank then the report looks odd. So the gap should be srinked as well. How to do it . This is very urgent . Please help me out.
Thanks
Ferozuse a formst trigeer on the field that returns false when you don't want to display the field.
-
Hi all
I create matrix report( in version 9i)
I want sort columns of report
when i use order by it sort rows but i want sort columns
my query is like this:
SELECT
Code,
name,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E') Activity,
SUM(amnt) amount
From Mytable
Where ....
group by
Code,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E')
my group base on code
my columns base on Activity
and cells are Amount
my report result is:
........ B E D A C
name1 1 1 1 1 2
name2 3 4 8 6 1
I want this :
........ A B C D E
name1 1 1 1 1 2
name2 3 4 8 6 1
....Hello,
How about this?
SELECT Code, name,
DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
From Mytable
WHERE ....
GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E') -
Matrix report with dynamic and fixed columns
Hi all,
I have a matrix report which has dynamic as well as few fixed columns.
It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
the actual layout should be like this
| category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......| 1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......| 1000 | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1000 | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
2234 | 7000This is my query, i have used union to get the row-wise column activity
/* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
SELECT DISTINCT /*ASSET_ID
SUM (cost),
SUM (cip_cost),
SUM (cip_cost_pk),
cat_desc--,sub_cat_desc
,activity
FROM (-- cip cost
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 <> '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
--cip cost pk
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
facc.cost cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 = '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
-- Disposal / Transferred / Retired
( -- retired
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_mass_ext_retirements_v ret
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = ret.asset_id
AND fa.asset_id = fat.asset_id
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
UNION
--transfer
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id
AND transtype = 'TRANSFER')
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
AND facc.asset_type = 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
GROUP BY cat_desc, activity
ORDER BY activityBrgds,
MaxHi all,
I have a matrix report which has dynamic as well as few fixed columns.
It is a fixed asset Report in which the sum(cost) in cell should be grouped according to column and row-wise.
The row consists of the activity such as additions, retirements etc and the dynamic column is the category and other fixed columns such as CIP cost, CWIP cost will be grouped only according to row.
the actual layout should be like this
| category 1 | category 2 | category 3 ...... | CIP cost | CWIP cost
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......| 1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......| 1000 | 2500but due to fixed colums in the layout the report builder pushes the fixed colums to the next row with single query i get
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1234 | 4500
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
1000 | 2500if i try to add those columns alone in a seperate query and then build the report i get the layout like this
| category 1 | category 2 | category 3 ...... |
Additions | Sum(cost) | Sum(cost) | Sum(cost) .......|
retirements | Sum(cost) | Sum(cost) | Sum(cost) .......|
CIP cost | CWIP cost
2234 | 7000This is my query, i have used union to get the row-wise column activity
/* Formatted on 03-Sep-12 5:23:11 PM (QP5 v5.114.809.3010) */
SELECT DISTINCT /*ASSET_ID
SUM (cost),
SUM (cip_cost),
SUM (cip_cost_pk),
cat_desc--,sub_cat_desc
,activity
FROM (-- cip cost
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 <> '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
--cip cost pk
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
facc.cost cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
DECODE (
facc.asset_type
|| '-'
|| fc.segment1
|| '-'
|| di.transtype,
'CIP'
|| '-'
|| fc.segment1
|| '-'
|| 'TRANSFER',
'CIP T/F',
'CIP-0012-' || di.transtype,
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1 || di.transtype,
'0',
'Additions'
activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fc.segment1 = '0012'
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
--AND facc.asset_type <> 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'
AND DECODE (
facc.asset_type || '-' || fc.segment1,
'CIP-0012',
'Additions Project Khalifa assets',
'CAPITALIZED-' || fc.segment1,
'0',
'Additions'
) <> '0'/*ORDER BY fb.asset_id*/
UNION
-- Disposal / Transferred / Retired
( -- retired
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
0 cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_mass_ext_retirements_v ret
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = ret.asset_id
AND fa.asset_id = fat.asset_id
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
UNION
--transfer
SELECT DISTINCT asset_id,
cost,
ytd_deprn,
deprn_amount,
deprn_reserve acc_deprn,
cost - deprn_reserve net_bk_val,
cip_cost,
cip_cost_pk,
description cat_desc,
fat_desc sub_cat_desc,
activity
FROM (SELECT DISTINCT
fb.asset_id,
fb.cost,
facc.cost cip_cost,
0 cip_cost_pk,
ds.ytd_deprn,
ds.deprn_reserve,
fc.description,
fat.description fat_desc,
ds.deprn_amount,
'Disposal / Transferred / Retired' activity
FROM fa_books fb,
fa_additions_b fa,
fa_methods fm,
fa_financial_inquiry_cost_v fic,
fa_categories_vl fc,
fa_capitalize_cip_v facc,
fa_additions_tl fat,
fa_deprn_summary ds,
fa_distribution_inquiry_v di
WHERE ds.asset_id = fa.asset_id
AND fb.asset_id = fa.asset_id
AND fb.asset_id = fic.asset_id
AND di.asset_id = fb.asset_id
AND fb.life_in_months = fm.life_in_months
AND fb.book_type_code = ds.book_type_code
AND fb.book_type_code = fic.book_type_code
AND fa.last_update_date >
TO_DATE (
'01'
|| 'JAN'
|| TO_CHAR (SYSDATE, 'RRRR'),
'DD-MON-RRRR'
AND ds.deprn_run_date =
(SELECT DISTINCT MAX (deprn_run_date)
FROM fa_deprn_summary
WHERE asset_id = fb.asset_id)
AND fic.transaction_header_id_in =
(SELECT DISTINCT
MAX (transaction_header_id_in)
FROM fa_financial_inquiry_cost_v
WHERE asset_id = fb.asset_id)
AND fb.date_effective =
(SELECT DISTINCT MAX (date_effective)
FROM fa_books
WHERE asset_id = fb.asset_id)
AND di.transaction_header_id =
(SELECT DISTINCT
MAX (transaction_header_id)
FROM fa_distribution_inquiry_v
WHERE asset_id = fb.asset_id
AND transtype = 'TRANSFER')
AND fa.attribute_category_code =
fc.segment1 || '-' || fc.segment2
AND fb.asset_id = facc.asset_id
AND fa.asset_id = fat.asset_id
AND facc.asset_type = 'CAPITALIZED'
AND fb.deprn_method_code = fm.method_code
AND ds.deprn_source_code <> 'BOOKS'/*ORDER BY fb.asset_id*/
GROUP BY cat_desc, activity
ORDER BY activityBrgds,
Max
Maybe you are looking for
-
Untrusted server cert chain for HTTPS on tomcat
I have written 2 servlets 1)One for sending username and password over HTTPS 2)One for receiving the username and password and decrypting this When I am executing the 1st servlet,i get the exception : Error is client : javax.net.ssl.exception.:untrus
-
Transferring music from 3GS to iPhone 5 without a PC
I have an iPhone 3gs with lots of downloaded and purchased music on it and want to transfer all this to an iPhone 5. The trouble is I don't have a PC at the moment so I cannot use the USB cable to sync etc in itunes. Is there another way to get all
-
Hey guyz can u help me out on how to make an apple ID on iPhone 4s without having a credit card information
-
HT1688 once ive updated an app is it possible to go back and downgrade?
once ive updated an app is it possible to go back and downgrade?
-
CAN WE CREATE A SEPARATE AUTHORISATION FOR BUSINESS EVENT
Hi Friends Kindly let us know whether we can give an authorization specifically for Business Events to acess I.e. R, W Usually we will give authorization for HR master as P-Origin. Then they can acess all. Please let us know whether can we give any a