Difference Between the grouped column
Hi ,
I have matrix based report in which the columns are dynamically generated based on the month and year.
3 filter value in the report
quarter,
year and
Previous 12 months .
Katherine community moderator reporting services helped me achieving the with a similar kind of report. Due to some difference from the previous requirement am posting a new question .
Current Matrix Outcome :
Desired Outcome
Please note that the Month columns are dynamically generated so for example if the filter value is quarterly
3 months will be generated , march-14,april-14,may-14 and then i need to display the difference
in new columns like march-14 - april-14 ,april-14-may-14. The column headers of the new differential columns i can achieve
but the difference between the types on monthly basis am unable to achieve.
Similarly it goes for the yearly and previous 12 months filter value.
Kindly let me know if more detail is required .
Thanks
Priya
Hi Priya,
According to your description, you have a matrix in your report. Now for each month, you want to always get the difference value between current month and previous month with columns generated. Right?
In Reporting Service, if we want to compare values of two adjacent columns in a matrix, the best way is using custom code to deal with the logic. In this scenario, we want to compare the current value with previous value. The difference value is always along
with columns generated. So we suggest put this column inside of group instead of appending them at the end of the matrix. In this column, we can call the function defined in the custom code. We have tested this case in our local environment. Here are steps
and screenshots for your reference:
Put the custom code into report:
Private queueLength As Integer = 2
Private queueSum As Double = 0
Private queueFull As Boolean = False
Private idChange As String=""
Dim queue As New System.Collections.Generic.Queue(Of Integer)
Public Function CumulativeQueue(ByVal currentValue As Integer,id As String) As Object
Dim removedValue As Double = 0
If idChange <> id then
ClearQueue()
idChange = id
queueSum = 0
queueFull = False
CumulativeQueue(currentValue,id)
Else
If queue.Count >= queueLength Then
removedValue = queue.Dequeue()
End If
queueSum += currentValue
queueSum -= removedValue
queue.Enqueue(currentValue)
If queue.Count < queueLength Then
Return Nothing
ElseIf queue.Count = queueLength And queueFull = False Then
queueFull = True
Return (queueSum-currentValue-currentValue)
Else
Return (queueSum-currentValue-currentValue)
End If
End If
End Function
public function ClearQueue()
Dim i as Integer
Dim n as Integer = Queue.Count-1
for i=n To 0 Step-1
queue.Dequeue()
next i
End function
Create a matrix based on your information. Put expression into corresponding position.
A: =Code.CumulativeQueue(Fields!Amount.Value,Fields!Type.Value)
B: =IIF(Previous(Fields!Month.Value) is nothing,"",MonthName(IIF(Previous(Fields!Month.Value) is nothing,1,Previous(Fields!Month.Value)))&" - "&MonthName(Fields!Month.Value))
C: =MonthName(Fields!Month.Value)
Ps : You may need to modify the custom code and expression based on the data type in your dataset.
Create parameter for filtering data.
Save and preview. It looks like below:
Reference:
SSRS 2008 R2 - Add moving average to column group
If you have any question, please feel free to ask.
Best Regards,
Simon Hou
Similar Messages
-
Accounting the differences between the group and statutory record
Hi guys,
In our set up, the group reporting requires the book to be closed within 10 days from the year end. However, due to various tax reasons, the stutory books can be kept open till 25th.
For example, there could be a credit note to be accounted between 10th and 25th which should appear in the statutory books as part of current year. But in Group reporting it should consider as the transaction for next year.
We have considered 2 options:
a) Do an adjustment transaction using Gl accounts with differnet range and exclude these accounts from group reporting. next year, reverse these transaction and account using normal GL accounts.
b) Account the adjustment transactions in a special period. In Group reporting, exclude these spacial transactions. However, the group reporting should include the special period from the previous year.
c) Use special purpose ledger. Account the transactions in special period and consider changing the period in the mapping rule (yet to prove).
Can anbody think about any other options?
many thanks
AMACommitment limit is not related to order value.
As per help file:
A warning message appears if <the customer's account balance>+ <the total amount in undeposited checks> + <the amount of the current document> exceeds the customer's commitment limit. -
Difference between the Field Group and Internal Table.
Hi all,
Can anybody tell me the difference between the Field group and Internal table and when they will used?
Thanks,
Sriram.Hi
Internal Tables: They are used to store record type data in tabular form temporarily in ABAP programming. Or we can say, it stores multiple lines of records for temporary use in ABAP programming.
A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.
Use
The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.
When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.
Regards
Ashish -
WHAT IS THE DIFFERENCE BETWEEN PHRASE GROUP AND PHRASE SET?
WHAT IS DIFFERENCE BETWEEN PHRASE GROUP AND PHRASE SET?
Hi Ramya,
Definition of a Phrase group is a number of phrases contained in a phrase library grouped according to logical criteria. A phrase can be assigned to only one phrase group.
Phrase set is grouping of phrases for a purpose which includes allowed phrases for a value assignment type and Default phrases for a value assignment type. A phrase can be assigned to a number of phrase sets.
Hope this helps you
Best Regards
Srinivas -
Difference between the user_bytes and the bytes of dba_data_files
What's the difference between the user_bytes and the bytes column of the dba_data_file view?
Hi,
>>Bytes : Size Occupied
No. The size of the datafile. Doesn't matter free or used space.
>>User Bytes: Size available for Occupying.
No and Yes. Keep in mind that it shows the total size of the file available for user data since it was creation minus the related metadata information.
In resume, take a look at below:
You can see below, that datafile has 1,500 MB of size but it has 1,499.9375 MB available for user data.
LEGATTI@ORACLE10> select file_id,file_name,bytes,user_bytes from dba_data_files where tablespace_name='USERS2';
FILE_ID FILE_NAME BYTES USER_BYTES
7 /u02/oradata/DB01/user02.dbf 1572864000 1572798464
LEGATTI@ORACLE10> SELECT Substr(df.tablespace_name,1,20) "Tablespace Name",
2 Substr(df.file_name,1,40) "File Name",
3 Round(df.bytes/1024/1024,2) "Size (M)",
4 df.increment_by "Increment By",
5 Round(e.used_bytes/1024/1024,2) "Used (M)",
6 Round(f.free_bytes/1024/1024,2) "Free (M)"
7 FROM DBA_DATA_FILES DF,
8 (SELECT file_id,
9 Sum(Decode(bytes,NULL,0,bytes)) used_bytes
10 FROM dba_extents
11 GROUP by file_id) E,
12 (SELECT Max(bytes) free_bytes,
13 file_id
14 FROM dba_free_space
15 GROUP BY file_id) f
16 WHERE e.file_id (+) = df.file_id
17 AND df.file_id = f.file_id (+)
18 AND df.file_id = 7
19 ORDER BY df.tablespace_name,
20 df.file_name;
Now, you can see that just 874 MB has been used from 1,499.9375 MB real space available.
Tablespace Name File Name Size (M) Increment By Used (M) Free (M)
USERS2 /u02/oradata/DB01/user02.dbf 1,500 0 874.88 625,05Now, is that clear?
Cheers
Legatti -
What is difference between user group and reference user group?
hi
guys,
what is difference between user group and reference user group?
your regards
p.sureshHi ,
Chk the link below for your clarifiacation.
http://help.sap.com/erp2005_ehp_03/helpdata/EN/5c/c1c81c445f11d189f00000e81ddfac/frameset.htm
Hope it helps.
Regards,
Amit
Edited by: Amit Kotwani on Sep 2, 2008 2:15 PM -
Query to find the difference between the last date and the second to the last date
Hi all,
Hope all is well.
I am working on the following problem because I am trying to improve my MS SQL skills. But I am stuck at the moment and I wonder if you could provide some assistance please. Here is the issue:
Table 1: Dividends
divId
ExDate
RecordDate
PayDate
Amount
Yield
symId
1
2013-02-19
2013-02-21
2013-03-14
0.23
0.00000
3930
2
2012-11-13
2012-11-15
2012-12-13
0.23
0.00849
3930
3
2012-08-14
2012-08-16
2012-09-13
0.20
0.00664
3930
4
2012-05-15
2012-05-17
2012-06-14
0.20
0.00662
3930
5
2012-02-14
2012-02-16
2012-03-08
0.20
0.00661
3930
6
2011-11-15
2011-11-17
2011-12-08
0.20
0.00748
3930
7
2011-08-16
2011-08-18
2011-09-08
0.16
0.00631
3930
8
2011-05-17
2011-05-19
2011-06-09
0.16
0.00653
3930
9
2011-02-15
2011-02-17
2011-03-10
0.16
0.00594
3930
10
2010-11-16
2010-11-18
2010-12-09
0.16
0.00620
3930
11
2010-08-17
2010-08-19
2010-09-09
0.13
0.00526
3930
12
2010-05-18
2010-05-20
2010-06-10
0.13
0.00455
3930
13
2010-02-16
2010-02-18
2010-03-11
0.13
0.00459
3930
Table 2: Tickers
symId
Symbol
Name
Sector
Industry
1
A
Agilent Technologies Inc.
Technology
Scientific & Technical Instruments
2
AA
Alcoa, Inc.
Basic Materials
Aluminum
3
AACC
Asset Acceptance Capital Corp.
Financial
Credit Services
4
AADR
WCM/BNY Mellon Focused Growth ADR ETF
Financial
Exchange Traded Fund
5
AAIT
iShares MSCI AC Asia Information Tech
Financial
Exchange Traded Fund
6
AAME
Atlantic American Corp.
Financial
Life Insurance
7
AAN
Aaron's, Inc.
Services
Rental & Leasing Services
8
AAON
AAON Inc.
Industrial Goods
General Building Materials
9
AAP
Advance Auto Parts Inc.
Services
Auto Parts Stores
10
AAPL
Apple Inc.
Technology
Personal Computers
11
AAT
American Assets Trust, Inc.
Financial
REIT - Office
12
AAU
Almaden Minerals Ltd.
Basic Materials
Industrial Metals & Minerals
I am trying to check the last date (i.e. max date) and also check the penultimate date (i.e. the second to the last date). And then find the difference between the two (i.e. last date minus penultimate
date).
I would like to do that for each of the companies listed in Table 2: Tickers. I am able to do it for just one company (MSFT) using the queries below:
SELECT
[First] = MIN(ExDate),
[Last] = MAX(ExDate),
[Diff] = DATEDIFF(DAY, MIN(ExDate), MAX(ExDate))
FROM (
SELECT TOP 2 Dividends.ExDate
FROM Dividends, Tickers
WHERE Dividends.symId=Tickers.symId
AND Tickers.Symbol='MSFT'
ORDER BY ExDate DESC
) AS X
Outputs the following result:
First
Last
Diff
2012-11-13
2013-02-19
98
But what I would like instead is to be able to output something like this:
Symbol
First
Last
Diff
MSFT
2012-11-13
2013-02-19
98
AAN
2012-11-13
2012-12-14
1
X
2012-11-13
2012-12-14
1
Can anyone please let me know what do I need to add on my query in order to achieve the desired output?
Any help would be greatly appreciated.
Thanks in advance.Could you try this?
create table Ticker (SymbolId int identity primary key, Symbol varchar(4))
insert into Ticker (Symbol) values ('MSFT'), ('ORCL'), ('GOOG')
create table Dividend (DividendId int identity, SymbolId int constraint FK_Dividend foreign key references Ticker(SymbolId), ExDate datetime, Amount decimal(18,4))
insert into Dividend (SymbolId, ExDate, Amount) values
(1, '2012-10-1', 10),
(1, '2012-10-3', 1),
(1, '2012-10-7', 7),
(1, '2012-10-12', 2),
(1, '2012-10-23', 8),
(1, '2012-10-30', 5),
(2, '2012-10-1', 10),
(2, '2012-10-6', 1),
(2, '2012-10-29', 7),
(3, '2012-10-1', 22),
(3, '2012-10-3', 21),
(3, '2012-10-7', 3),
(3, '2012-10-12', 9)
WITH cte
AS (SELECT t.Symbol,
d.ExDate,
d.Amount,
ROW_NUMBER()
OVER (
partition BY Symbol
ORDER BY ExDate DESC) AS rownum
FROM Ticker AS t
INNER JOIN Dividend AS d
ON t.SymbolId = d.SymbolId),
ctedate
AS (SELECT Symbol,
[1] AS maxdate,
[2] AS penultimatedate
FROM cte
PIVOT( MIN(ExDate)
FOR RowNum IN ([1],
[2]) ) AS pvtquery),
cteamount
AS (SELECT Symbol,
[1] AS maxdateamount,
[2] AS penultimatedateamount
FROM cte
PIVOT( MIN(Amount)
FOR RowNum IN ([1],
[2]) ) AS pvtquery)
SELECT d.Symbol,
MIN(MaxDate) AS maxdate,
MIN(penultimatedate) AS penultimatedate,
DATEDIFF(d, MIN(penultimatedate), MIN(MaxDate)) AS numberofdays,
MIN(MaxDateAmount) AS maxdateamount,
MIN(penultimatedateAmount) AS penultimatedateamount,
MIN(MaxDateAmount) - MIN(penultimatedateAmount) AS delta
FROM ctedate AS d
INNER JOIN cteamount AS a
ON d.Symbol = a.symbol
GROUP BY d.Symbol
ORDER BY d.Symbol
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
Thanks!
Aalam | Blog (http://aalamrangi.wordpress.com) -
DIFFERENCE BETWEEN THE FULL AND BULK-LOGGED RECOVERY MODEL
DIFFERENCE BETWEEN THE FULL AND BULK-LOGGED RECOVERY MODEL
In bulk logged recovery mode certain bulk operations are minimally logged. In FULL recovery mode these are fully logged. These bulk operations are as mentioned below
1. SELECT INTO
2. BULK IMport operations including BULK INSERT and BCP
3. INSERT INTO SELECT command using the OPENROWSET(BULK) function
4. Partial updates to columns having large value data type
5. Using WRITE clause in UPDATE statements
6. Index operations e.g CREATE INDEX, ALTER INDEX REBUILD , DROP INDEX
In Bulk Logged Recovery Mode when you execute these operations SQL Server only logs the fact that these operation occured and information about space allocation. The actual change in the data is maintained in the BCM (Bulk
Changed Map)
Since the actual changes are not recorded in the log file, the log file size in the reletively less in size but this tradeoff comes with the price of increased backup time. This is so because during the log backup its not just the log being backup, but also
the extents that are marked by the Bulk Changed Map as changed.
SQLEnthusiast
http://sqlsimplified.com/
Please click the Mark as Answer button if a post solves your problem! -
Differences between the alv's and alv grid dispaly
hi guys
.........please send the differences between the alv's and alv grid display.
thanks....Hi Midathala,
Plz go through the links might be useful to you.
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
Check the program in the following link:
http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
13. Top-of-page in ALV
selection-screen and top-of-page in ALV
14. ALV Group Heading
http://www.sap-img.com/fu037.htm
How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
15. ALV output to PDF conversion
It has an example code for PDF Conversion.
http://www.erpgenie.com/abap/code/abap51.htm
converting the output of alv in pdf
Thanks
Mohinder Singh Chauhan -
What's the difference between the triangle icon and the square icon on the
What's the difference between the triangle icon and the square icon on the Bookmarks Bar, and how do you make the square thing happen?
Both mean that the bookmark is a group or folder of multiple addresses.
The triangle is the default setting, meaning that usually you click and choose a single address to open in the group. You can also right-click on the group name to select "Open in Tabs" to see ALL the addresses open in individual tabs.
The square is this behaviour (open all addresses in tabs) fixed, so that it ALWAYS opens that way, even with a left click. If you want to access an individual address now, you have to use option-click.
To switch between triangle and square, open your bookmarks screen (the book icon on the far left of the bookmarks bar, or Bookmarks menu - Show all Bookmarks, select the group you want to change, and tick the box marked "Auto-Click". You can of course switch back to triangle (default) behaviour in the same way.
Matt -
Difference between "account group" and "reconciliation account"
Hello,
I am new to SAP and I would like to understand the difference between the "account group" and the "reconciliation account" that appear both in the vendor master records.
From what I read, "account group" is just a classification but has no "accounting" impact whereas "reconciliation account" (goods suppliers, overhead expenses suppliers...) do have an accounting impact.
However I am not sure so I would like a confirmation on that and if possible examples so I could really understand.
Thank you.Hi,
The account group is a way to divide vendors into groups for reporting later on.
The account group is also the link to the number range and the field selection functionality.
Please refer the below link for more clarity.
http://help.sap.com/saphelp_46c/helpdata/en/53/c98647ca3711d2b494006094b9114a/frameset.htm
Account group
The reconciliation account is the account is the account which is posted to at invoice receipt stage where the vendor account represents the sub ledger and the reconcilation account the ledger.
Reconciliation Account
http://sapdocs.info/sap/fico/reconciliation-accounts-and-special-gl-indicator/
Hope it helps you.
Thanks. -
What is the difference between the Canon T3i the T5, and the T5i Is the only difference the 3 , 4, 5 fps only?
The Canon Web site has a comparison option that lets you display the specs of the three cameras, feature by feature, in adjacent columns.
Bob
Boston, Massachusetts USA -
Difference between Admin Groups and Analytics Web Groups
Hi All,
Can anyone tell me what is the difference between the user Groups we can define in Siebel Analytic Administration Tools -RPD and Siebel Analytics Web Groups?
Also what is the relationships between them? In my environment I'm getting sharp difference between these groups.
Thanks for reading.
SudiptaHi Sudipta,
Please find the below link,
Security in OBIEE
Thanks,
Vino -
Difference between material group and external material group
Hi,
Can anybody let me know the difference between the material group and external materila group from the business perspective.
ThanksHi Raghunandan,
Material Group : Materials having similar attributes will be goruped together and assigned to a Material Group.
Material groups are Extensively useful during :
Limit the Scope of Analysis
Reporting Purpose
External material group : Key that you can use to assign the material to an external material group or to a material group determined according to external systematics.
In General, External material groups are nothing but external representation of group of material which are extensively used in supply souce determination for provions materials related to retail and some other functions
In short if your Internal material group for example bearing is 0001 you can group externally further based on manufacturer like FAG for NRB. No accounting activity is based on it
Reg,
Ashok -
Difference between AP groups and HREAP or flexconnect
Hi Experts ,
Can anyone please tell me the difference between AP groups and HREAP functionality?
Is the AP group for within one office location ? and Hreap is over WAN?
Regards,
Vijay.AP groups and H-REAP/FlexConnect are used differently. AP Groups define what SSID's and WLAN to VLAN mapping (local mode) that ap's in the group will have. H-REAP/FlexConnect group is only used when the ap's are in this mode and you define ap's that are close together in that group for fast roaming if using 802.1x. If your only using pre-shared key or non-802.1x, then you really don't need to use H-REAP/FlexConnect groups. You can have ap's in both ap groups or h-reap/flexconnect groups, that is why you need to understand what each does.
FlexConnect Grups:
http://www.cisco.com/c/en/us/td/docs/wireless/controller/7-4/configuration/guides/consolidated/b_cg74_CONSOLIDATED/b_cg74_CONSOLIDATED_chapter_010001111.html
AP Groups:
http://www.cisco.com/c/en/us/td/docs/wireless/controller/7-4/configuration/guides/consolidated/b_cg74_CONSOLIDATED/b_cg74_CONSOLIDATED_chapter_01011111.html
Scott
Maybe you are looking for
-
Hi All, I want to create one structure with packed type fields.Could anybody tell me how to define it. Regards Lalit
-
KEXTs: How to update helloKernel.kext to run on Snow Loepard?
Hi I'm working through the HelloKernel tutorial in the Kernel Extension Programming Topics document. However that's a few years old now and hasn't been updated, and there have obviously been some relevant changes with Snow Leopard with the consequenc
-
I rented a movie and says I have 1 Download Available. When I hit "Download Now" nothing happens. Any help on this?
-
[ WRT120N ] I can't seem to forward this port..
alright, so idk if any of you know of runescape private servers but i am currently in the making of one and i've been having a problem letting people connect to my server because i haven't forwarded port 43954. i've been trying to forward this port f
-
Any docs with new 10g features?
Hey, Were currently evaluating OEM to use to monitor our environments but there are a couple of key features that our manager wants that our current homegrown system offers. 1. Call escallation.. If a problem still exists after the Nth poll by OEM. B