How to get Difference of a Result set in reports
Hello,
I am trying to get difference (variance) of sales in past year and current year. Below is the report which accumulates the sales for 2013 and 2014 and also accumulates the Sales for both year , but how can we get the difference of sales in Years. Any ideas really appreciated.
Thank you,
Pavan
Harish,
I tried creating Some restriction Key figures and calculated key figures as I want this by every month as well. Not a straight forward (easy)way. I had to create many Key figures.
I really appreciate your response.
Thank you,
Pavan.
Similar Messages
-
How to get previous row of result set in select query?
I want to access the previous row of an result set obtained yet, in the same selectquery .
How can I do that?Use analytical functions.
For example:
create table top_n_test (
a number,
b varchar2(10)
insert into top_n_test values (1, 'one');
insert into top_n_test values (2, 'two');
insert into top_n_test values (3, 'three');
insert into top_n_test values (4, 'four');
insert into top_n_test values (5, 'five');
insert into top_n_test values (6, 'six');
insert into top_n_test values (7, 'seven');
insert into top_n_test values (8, 'eight');
insert into top_n_test values (9, 'nine');
commit;
select a, b from (
select
a,b,
rank() over (order by b) r
from
top_n_test
where
r<4;
A B
8 eight
5 five
4 fourHTH
Ghulam -
How should i use the two results sets in one single report data region?
Hi frnz,
I have to create a report using the below condition...
Here my given data set query gives you the two result sets ,so how should i use that two result sets information in single report....when i accessing that data set query it will take the values off the first result set not for the second result set.
without using sub report and look up functionality..... if possible
is there any way to achieve this.....Please let me know..
Thanks!You cant get both resultsets in SSRS. SSRS dataset will only take the first resultset
you need to either create them as separate queries or merge them into a single resultset and return with ad additional hardcoded field which indicates resultset (ie resultset1,resultset2 etc)
Then inside SSRS report you can filter on the field to fetch individual resultsets at required places. While merging you need to make sure metadata of two resultsets are made consistent ie number of columns and correcponding column data types should be same.
In absence of required number of columns just put some placeholders using NULL
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to get the kerning value and set it to back use script?
hi,guys
I come back again.
I encountered a kerning problem.
how to get the kerning value and set it to back use script?
Thanks very much!For both cases, the filename can be found on the FILE.ReceivedFileName Context Property. You can access this Property in a Pipeline Component or Orchestration and take any action you want, such as apply to a database.
The value is accessed by: MyReceivedMessage(FILE.ReceivedFileName)
In the case of a duplicate EDI Interchange, you would use the Failed Message Routing feature to capture the error message with either an Orchestration or Send Port. -
How can get difference between 2 dates in the form of days
how can get difference between 2 dates in the form of days
Hi,
Check the following program:
REPORT ZDATEDIFF.
DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
Regards,
Bhaskar -
How to get relationship between two views in the reports
How to get relationship between two views in the reports, I am doing a deletion program , it is fully relates to views , how to get relationship between them in the reports
Hi,
Please explain your question in detail...what do you want to read ?
If you want to know about the navigation links between the views then you can use APIs like
wdComponentAPI.getComponentInfo().findInWindows("windowName").getViewUsageByID("Name").getNavigationLinks();
Iterate through the navigationLinkInfo from above collection and can read the other properties .
I haven't tried the above , but it should work !!!
Regards,Anilkumar -
How to get total number of result count for particular key on cluster
Hi-
My application requirement is client side require only limited number of data for 'Search Key' form total records found in cluster. Also i need 'total number of result count' for that key present on the custer.
To get subset of record i'm using IndexAwarefilter and returning only limited set each individual node. though i get total number of records present on the individual node, it is not possible to return this count to client form IndexAwarefilter (filter return only Binary set).
Is there anyway i can get this number (total result size) on client side without returning whole chunk of data?
Thanks in advance.
Prashantuser11100190 wrote:
Hi,
Thanks for suggesting a soultion, it works well.
But apart from the count (cardinality), the client also expects the actual results. In this case, it seems that the filter will be executed twice (once for counting, then once again for generating actual resultset)
Actually, we need to perform the paging. In order to achieve paging in efficient manner we need that filter returns only the PAGESIZE records and it also returns the total 'count' that meets the criteria.
If you want to do paging, you can use the LimitFilter class.
If you want to have paging AND total number of results, then at the moment you have to use two passes if you want to use out-of-the-box features because LimitFilter does not return the total number of results (which by the way may change between two page retrieval).
What we currently do is, the filter puts the total count in a static variable and but returns only the first N records. The aggregator then clubs these info into a single list and returns to the client. (The List returned by aggregator contains a special entry representing the count).
This is not really a good idea because if you have more than one user doing this operation then you will have problems storing more than one values in a single static variable and you used a cache service with a thread-pool (thread-count set to larger than one).
We assume that the aggregator will execute immediately after the filter on the same node, this way aggregator will always read the count set by the filter.
You can't assume this if you have multiple client threads doing the same kind of filtering operation and you have a thread-pool configured for the cache service.
Please tell us if our approach will always work, and whether it will be efficient as compared to using Count class which requires executing filter twice.
No it won't if you used a thread-pool. Also, it might happen that Coherence will execute the filtering and the aggregation from the same client thread multiple times on the same node if some partitions were newly moved to the node which already executed the filtering+aggregation once. I don't know anything which would even prevent this being executed on a separate thread concurrently.
The following solution may be working, but I can't fully recommend it as it may leak memory depending on how exactly the filtering and aggregation is implemented (if it is possible that a filtering pass is done but the corresponding aggregation is not executed on the node because of some partitions moved away).
At sending the cache.aggregate(Filter, EntryAggregator) call you should specify a unique key for each such filtering operation to both the filter and the aggregator.
On the storage node you should have a static HashMap.
The filter should do the following two steps while being synchronized on the HashMap.
1. Ensure that a ConcurrentLinkedQueue object exists in a HashMap keyed by that unique key, and
2. Enqueue the total number count you want to pass to the aggregator into that queue.
The parallel aggregator should do the following two steps while being synchronized on the HashMap.
1. Dequeue a single element from the queue, and return it as a partial total count.
2. If the queue is now empty, then remove it from the HashMap.
The parallel aggregator should return the popped number as a partial total count as part of the partial result.
The client side of the parallel aware aggregator should sum the total counts in the partial result.
Since the enqueueing and dequeueing may be interleaved from multiple threads, it may be possible that the partial total count returned in a result does not correspond to the data in the partial result, so you should not base anything on that assumption.
Once again, that approach may leak memory based on how Coherence is internally implemented, so I can't recommend this approach but it may work.
Another thought is that since returning entire cached values from an aggregation is more expensive than filtering (you have to deserialize and reserialize objects), you may still be better off by running a separate count and filter pass from the client, since for that you may not need to deserialize entries at all, so the cost on the server may be lower.
Best regards,
Robert -
How to get a list of Layout Sets
Hi Experts,
How do I get a list of Layout sets in Portal ?
I am using a KM Navigation IView to show a list of External Links. I have used a copy of Links IView for this. The Layout set used here is "LinkListExplorer".
The problem with this layout set is it provides an option of Organize Entries to all End users. An end user might potentially delete a link or edit it due to this.
I want to get rid of Organize Entries feature in this IView, which I feel can be achieved only by changing Layout of the IVIew.
Please guide me to list of Layout sets or a way to maintain permissions for Links IView.
Thanks,
Yomesh.System Administration -> System Configuration -> Knowledge Management -> Content Management
then,
User Interface -> Settings -> Layout Set
You will see lots of layouts sets that you can use... -
How to get the list of Group set in each Users in MS Active Directory
Hi. I would like to know if you know how to get the set group of each user in Active Directory?
We have this sample code
String INITCTX ="com.sun.jndi.ldap.LdapCtxFactory";
//String MY_HOST = "ldap://myserver/ou=dev,dc=test,dc=com,dc=ph";
String MY_HOST ="ldap://myserver.dev.test.com.ph:389/dc=dev,dc=test,dc=com,dc=ph";
String strUsername,strPassword;
try
strUsername = Request.getParameter("username").toLowerCase().trim();
strPassword = Request.getParameter("password").toLowerCase().trim();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
env.put(Context.PROVIDER_URL, MY_HOST);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL,strUsername+"@dev.lst.com.ph");
env.put(Context.SECURITY_CREDENTIALS, strPassword);
After validating the User Name and Password the next task is to Retrieve the group list of the User.Nope I want the log-in user to retrieve its Group where he is belong. I have this following code
strUsername = Request.getParameter("username").toLowerCase().trim()+"@dev.test.com.ph";
strPassword = Request.getParameter("password").toLowerCase().trim();
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
env.put(Context.PROVIDER_URL, MY_HOST);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL,strUsername);
env.put(Context.SECURITY_CREDENTIALS, strPassword);
// enable tracing
env.put("com.sun.naming.ldap.trace.ber", System.err);
// Create the initial context
DirContext initCtx = new InitialDirContext(env);
// Get the target context
DirContext targetCtx = (DirContext)initCtx.lookup("");
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
// Perform the search on the target context
NamingEnumeration enum = targetCtx.search("","(userPrincipalName="+strUsername+")",constraints);
javax.naming.directory.Attributes attrs;
NameClassPair item;
String[] attrIds = new String[]{"MemberOf"};
// For each answer found, get its "Groups" attribute
// If relative, resolve it relative to the target context
// If not relative, resolve it relative to the initial context
while (enum.hasMore()) {
item = (NameClassPair)enum.next();
Out.println(item);
attrs = targetCtx.getAttributes(item.getName(), attrIds);
Out.println(attrs + "<br>");
initCtx.close();
It returns all this string :
{memberof=memberOf: CN=CMCanadaRD,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=iMngrCanadaRW,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=Domain Users,CN=Users,DC=dev,DC=test,DC=com,DC=ph, CN=Backup Operators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph, CN=Administrators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph}
How can i retrieve the Group named CMCanadaRW and CMCanadaRD on the Attribute?
Thanks -
How to get class B's results in class A
Hi ,
Let's say I have classA and classB ,
classB has number of statements , lets say it has 200 lines that are executable. Here are very important result at line number 198 after processing the above 197 lines . lets say variable CLASSB.RESULT holds this result.
my question is how to get this value of CLASSB.RESULT(variable) from line 198 to CLASSA's any variable.
hope I could explain my question.
thanksYour question is vague. If you're asking how to store a value from Class A in Class B, it might as simple as
classBObject.setValue(classAObject.getValue()); -
How to Add extra data in result set of cfquerry?
hi all,
I am new to cold fusion please help me
i am using the cfquery tag for executing a select query and getting the system name and system is from that........
But i want an extra system name and system id to add to the result of that query with out changing the data base ..............
please any one suggest me ...........IT's URGENT
Thanks in advance
SudheerYou'll have to use an array and the function queryAddColumn. An example follows.
Suppose I have a result set called myQuery. There are 5 rows in it. I wish to add 2 new columns to the query, on the fly. The column names are username(type varchar) and userID(type integer)
<!--- Create array corresponding to column username--->
<cfset usernameArray = ArrayNew(1)>
<cfset usernameArray[1] = "[email protected]">
<cfset usernameArray[2] = "[email protected]">
<cfset usernameArray[3] = "[email protected]">
<cfset usernameArray[4] = "[email protected]">
<cfset usernameArray[5] = "[email protected]">
<!---
The next line adds the new column, username, to the query. That's it. Done.
The array indices correspond to the row numbers in the query.
The function queryAddColumn returns the column number for the newly added column
(in case you'll need it, which you usually wont ).
--->
<cfset columnNumber = queryAddColumn(myQuery, "username", "VarChar", usernameArray)>
<!--- Now, do the same for the next new column, userID --->
<cfset userIDArray = ArrayNew(1)>
<cfset userIDArray[1] = "23">
<cfset userIDArray[2] = "121">
<cfset userIDArray[3] = "9">
<cfset userIDArray[4] = "76">
<cfset userIDArray[5] = "44">
<cfset columnNumber = queryAddColumn(myQuery, "userID", "integer", userIDArray)> -
How do I break up a result set over various pages?
I would like some example code of how to breakup a result set that I am using in a form.
There are too many results for the form to currently work properly on one page so I have to do it over several web pages, using a next page link etc...
I am currently using servlets.
If anyone has an idea of how to do this differently have at it and let me know what to do. I prefer code examples.I would change the select query so that it doesn't return the whole resultset. Check your database manual to see if your database supports something like limit. E.g. this query will only return the 20 first records if you are using mysql.
select *
from tablename
limit 0,20
Kaj -
How to get only the first result in extract function
do you know how to get only the first element of the function extract.
v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
thanks in advanceTwo ways .....
1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
Make sense?
Paul -
How to create a browsable, distributable result set?
I want do develop a web application, which must be able to browse (previous page, next page) in large result sets. The web application is distributed on several servers (persistent session). What is the way to handle this?
The web application is distributed on
several servers (persistent session). What is the way
to handle this?Can you explain what a persistent session distributed on serveral servers means? -
Custom row-fetch and how to get column values from specific row of report
Hi -- I have a case where a table's primary key has more than 3 columns. My report on the
table has links that send the user to a single-row DML form, but of course the automatic
fetch won't work because 1) I can't set more than 3 item values in the link and 2) the
auto fetch only handles 2 PK columns.
1)
I have written a custom fetch (not sure it's the most elegant, see second question) that is working
for 3 or few PK columns (it references the 1-3 item values set in the link), but when there are
more than 3, I don't know how to get the remaining PK column values for the specific row that was
selected in the report. How can I access that row's report column values? I'll be doing it from the
form page, not the report page. (I think... unless you have another suggestion.)
2)
My custom fetch... I just worked something out on my own, having no idea how this is typically
done. For each dependent item (database column) in the form, I have a source of PL/SQL
function that queries the table for the column in question, using the primary key values. It works
beautifully, though is just a touch slow on my prototype table, which has 21 columns. Is there
a way to manually construct the fetch statement once for the whole form, and have APEX be smart
about what items get what
return values, so that I don't have to write PL/SQL for every item? Because my query data sources
are sometimes in remote databases, I have to write manual fetch and dml anyway. Just would like
to streamline the process.
Thanks,
CarolHI Andy -- Well, I'd love it if this worked, but I'm unsure how to implement it.
It seems I can't put this process in the results page (the page w/ the link, that has multiple report rows), because the link for the row will completely bypass any after-submit processes, won't it? I've tried this in other conditions; I thought the link went directly to the linked-to page.
And, from the test of your suggestion that I've tried, it's not working in the form that allows a single row edit. I tried putting this manually-created fetch into a before header process, and it seems to do nothing (even with a hard-coded PK value, just to test it out). In addition, I'm not sure how, from this page, the process could identify the correct PK values from the report page, unless it can know something about the row that was selected by clicking on the link. It could work if all the PK columns in my edit form could be set by the report link, but sometimes I have up to 5 pk columns.
Maybe part of the problem is something to do with the source type I have for each of the form items. With my first manual fetch process, they were all pl/sql functions. Not sure what would be appropriate if I can somehow do this with a single (page level?) process.
Maybe I'm making this too hard?
Thanks,
Carol
Maybe you are looking for
-
How to get slider window in javafx
How to get Slider window in javafx when we click on button slider window should open with sliding effect and when we clock on close button of slider window it should be close with sliding effect....plss send the link regarding this or if possible the
-
How do I downgrade back from Numbers 3.0 to Numbers 2.3
Numbers 3.0 is a real disaster as a lot of essential features have been removed. I find it unusable for practical purposes. How can i get back to Numbers 2.3?
-
Bringing Photoshop created 3D text into After Effects to work in 3D space?
Hi everyone, I created 3D text (logo) in photo shop and want to bring it into after effects in order to use it in 3D space. Is it possible? I cant figure out how to bring it in there and still be able to use it in 3D space. it just comes out as a fla
-
Is alternate email address the same as a rescue email?
I was just wondering if an alternate address is the same as a rescue email because I need to reset my security questions.
-
I'm getting this error. what is the fix??
I'm getting this error when trying to use the email setup on Verizon. it keeps crashing? please advise.