Get value based on last date
I have a report that takes 2 date parameters ("Start Date" and "End Date"). Get fields back based on that criteria....I want to create a formula field that shows me the "Amount" field data that is equal to the "End Date".
How can I do that?
Thanks in Advance!!
Hi shaun,
You can take a running total of the date as
Running total name : datecount
Summary Field to Summarize as : yourdatefield
Type of summary : Nth largest
N is : 1
Evaluate
For Each Record
Reset
Never
Now Create a Formula for ur fileld as
if {Command.Yourdate} = {#datecount} then {Command.fieldname}
I hope this solves your problem
Regards,
Pradeep
Similar Messages
-
Query to get values based on a date range.
11g.
Hi there,
I have a simple requirement(hopefully).
I have a parameter which is basically a count range which when I pass the sql query should fetch the values from a column falling in that range.
My table is item details
Item cost
item1 1
item2 10
item3 20
item4 3
.I have a parameter which I have to pass to this query where items are listed based on the cost.
So I want to select items which cost between 0 -10, 11-20, 21-30 and 31-40
Now I am using Apex to show the count report like
0-10 11- 20 21- 30 31- 40
3 2 0 0
The numbers are hyperlinked and I pass the parameters based on which another report shows the details. So if the user clicks on number 3 in the report. The underlying query would be something like
select * from item_Details where cost between 0 and 10.So I was wondering how do pass the parameter to the sql in the best possible way to get the costs based on the range?
Maybe the parameters should be some code which can be decoded in the SQL?
Any help or suggestions please?
Thanks,
RyanHi,
Try this to pass the parameter in the query...
select * from item_Details where cost between to_number(substr('0-10',0,instr('0-10','-')-1)) and to_number(substr('0-10',instr('0-10','-')+1,length('0-10'));
Regards,
Niha -
Get Old Value and the new value based on the date
Hi
I have a table called roster created below with following insert statements.
CREATE TABLE ROSTER
ROSTER_EMPLOYEE_DEF_ID NUMBER,
EMPLOYEE_ID NUMBER,
DEFINITION_REGION_CODE NUMBER,
DEFINITION_DISTRICT_CODE NUMBER,
DEFINITION_TERRITORY_CODE NUMBER,
START_DATE DATE,
END_DATE DATE
INSERT INTO ROSTER
(ROSTER_EMPLOYEE_DEF_ID,EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE)
VALUES
(1,299,222,333,444,'1-JUN-2011','30-JUN-2011')
INSERT INTO ROSTER
(ROSTER_EMPLOYEE_DEF_ID,EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE)
VALUES
(2,299,223,334,445,'1-JUL-2011','20-JUL-2011')
INSERT INTO ROSTER
(ROSTER_EMPLOYEE_DEF_ID,EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE)
VALUES
(3,299,224,335,446,'1-AUG-2011','30-AUG-2011')
INSERT INTO ROSTER
(ROSTER_EMPLOYEE_DEF_ID,EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE)
VALUES
(4,300,500,400,300,'1-JUN-2011','20-JUN-2011')
INSERT INTO ROSTER
(ROSTER_EMPLOYEE_DEF_ID,EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE)
VALUES
(5,300,501,401,301,'1-JUL-2011','20-JUL-2011')
In the above table we have columns like
EMPLOYEE_ID,DEFINITION_REGION_CODE,DEFINITION_DISTRICT_CODE,DEFINITION_TERRITORY_CODE,START_DATE,END_DATE
The result i am looking from the above table is based on the EMPLOYEE_ID OF START_DATE AND END_DATE
I need to get OLD_DEFINITION_REGION_CODE and the NEW_DEFINITION_CODE
Similarly OLD_DEFINITION_REGION_CODE and the NEW_DEFINITION_REGION_CODE
and OLD_DEFINITION_TERRITORY_CODE and the NEW_DEFINITION_TERRITORY_CODE
I need to get one row of data for each employee saying old value and new value
for employee 299 there are 3 records it must give the new record which is the latest date i.e start date 1-aug-2011 and end date 30-aug-2011 old record will be
start date 1-jul-2011 and 20-jul-2011
For the above table data i need to get the data as below
EMPLOYEE_ID OLD_DEFINITION_REGION_CODE NEW_DEFINITION_CODE OLD_DEFINITION_REGION_CODE NEW_DEFINITION_REGION_CODE START_DATE END_DATE
299 223 224 334 335 20-JUL-11 30-AUG-11
300 500 501 400 401 20-JUN-11 20-JUL-11
Please suggest me to get the above result based on the data. Please let me know if my posts are not clear
Thanks
SudhirSELECT EMPLOYEE_ID,
OLD_DEFINITION_REGION_CODE,
NEW_DEFINITION_REGION_CODE,
OLD_DEFINITION_DISTRICT_CODE,
NEW_DEFINITION_DISTRICT_CODE,
OLD_DEFINITION_TERRITORY_CODE,
NEW_DEFINITION_TERRITORY_CODE,
START_DATE,
END_DATE
FROM (
SELECT EMPLOYEE_ID,
ROW_NUMBER() OVER(PARTITION BY EMPLOYEE_ID ORDER BY START_DATE DESC) RN,
LAG(DEFINITION_REGION_CODE) OVER(PARTITION BY EMPLOYEE_ID ORDER BY START_DATE) OLD_DEFINITION_REGION_CODE,
DEFINITION_REGION_CODE NEW_DEFINITION_REGION_CODE,
LAG(DEFINITION_DISTRICT_CODE) OVER(PARTITION BY EMPLOYEE_ID ORDER BY START_DATE) OLD_DEFINITION_DISTRICT_CODE,
DEFINITION_DISTRICT_CODE NEW_DEFINITION_DISTRICT_CODE,
LAG(DEFINITION_TERRITORY_CODE) OVER(PARTITION BY EMPLOYEE_ID ORDER BY START_DATE) OLD_DEFINITION_TERRITORY_CODE,
DEFINITION_TERRITORY_CODE NEW_DEFINITION_TERRITORY_CODE,
LAG(END_DATE) OVER(PARTITION BY EMPLOYEE_ID ORDER BY START_DATE) START_DATE,
END_DATE
FROM ROSTER
WHERE RN = 1
EMPLOYEE_ID OLD_DEFINITION_REGION_CODE NEW_DEFINITION_REGION_CODE OLD_DEFINITION_DISTRICT_CODE NEW_DEFINITION_DISTRICT_CODE OLD_DEFINITION_TERRITORY_CODE NEW_DEFINITION_TERRITORY_CODE START_DAT END_DATE
299 223 224 334 335 445 446 20-JUL-11 30-AUG-11
300 500 501 400 401 300 301 20-JUN-11 20-JUL-11
SQL> SY. -
Month Year values based on Posting Date
In my super huge extra large InfoCube (0CFM_C10) I got a lot of data. I take Posting Date, some KFG and CalMonth/Year. Unfortinally CalMonth/Year duplicates records, if I drop it off the columns/rows I get valid data by Posting Date.
My question is this - is it possible to create some MonthYear Calculated KFG/field/formula or smthng. based on Posting Date? In other words I need Month/Year in rows/ columns or free characteristics...
Edited by: Gediminas Berzanskis on Mar 18, 2008 10:18 AMDear,
When canceling a payment which was created in previous posting periods,
we get system message "Date deviates from permissible range",so
the workaround is changing back the posting period to the previous one
and try to cancel the payment.
However,another system message pops up when we try to cancel payment
after changing back the posting period,which is the "creation date" or
"posting date".
In this scenario, you should select the second option from the
cancellation options window, which is the 'Creation date'. I would like
to explain more below.
Posting Date- means the posting date of the cancellation document, it's
not the posting date of the incoming payment that you wanna perform the
cancellation. In your case, selecting this 'posting date' option, system
deems that you want to post this cancellation document on its own
posting date.
Creating Date- means the posting date/creation date of the incoming
payment, it makes sense that the system works fine if you select this
option. If you cancel the incoming payment and check the JE generated,
you will find that the posting date of this cancellation document is
actually recorded as the posting date of the incoming payment.
Wish it helps you.If you have any problems,please kindly let me know.
Thanks and best regards,
Apple -
Calculate difference in value based on two date parameters
Hi All,
I have a table and need to calculate the difference in rent amount for a property based on two date parameters.
I have uploaded sample data here:
https://app.box.com/s/pu8oa4f3jhrhm0ylshdz2fuo7541vn4z
Thanks
JagHi jaggy99,
Do you have the knowledge of
Excel Add-In? If you don't have knowledge of C#/VB.NET language and Visual Studio, I don't think Excel Add-In is what you want. As I said previously, your problem is totally about the business logic, we don't provide solution for a complete requirement.
Based on your sample data, I think VBA code is suitable.
If you're not familiar with VBA, please take a look at the MSDN documents for scratch:
Getting Started with VBA in Excel 2010
The steps should be like this:
1. Sort all the records by [Rent Change Date] field
2. Loop throuth the records and find the FromDate and ToDate as well as the corresponding [Rent Charged] field
3. Calculate the difference and save the data into a new range
It's not so hard, please have a try, if you encounter any development problems, you can post in this forum.
Thanks.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Round Decimal value based on last digit
Hi Experts,
I'm trying to round the decimal value based on its last digit. If the last digit is >5 then add +1 to the digit before that and remove the last digit else just remove.
ie.
-59664.15000000005 should become -59664.15
-21308625.00000002 should become -21308625
-85234500.00000006 should become -85234500.0000001
18288102.85714287 should become 18288102.8571429I tried with Round Function but it did not help,
Pls assist.
Thanks!Got it done just took the length and did the change.. sorry for this lame question.. should have tried before posting the question. Tx for your time...
-
Getting Value Based on Descending value of the count
Hi,
I have values in the list as below
Title,Count
title1,3
title2,5
title3,4
Now i need to fetch the title column value based on descending order of the count column value.
But writing spquery as below but not getting the exact value
"<OrderBy><FieldRef Name='Count' Ascending='FALSE' /></OrderBy>";
Please let me know if i am making any mistake here.
Regards,
Sudheer
Thanks & Regards, SudheerHi,
In addition to Hemendra, there is OOB option to order items in descending order per one column value.
You could create a view for this list, and configure in Sort section.
Regards,
Rebecca Tu
TechNet Community Support -
Hi ,
i need a query that will determine the weeks based on start date.
if the table consists of:
vDate vAmount
06/25/2007 100
06/27/2007 200
07/04/2007 400
If one enters start date as 6/25/2007 , amounts should be broken out in 7 day increments.
Result should be
week1 300
week2 400
where week1 should be from 6/25/2007 to 07/01/2007,
week2 should be from 07/02/2007 to 07/08/2007
and start date is not always on a Monday or Sunday...
any idea?
thanks in advancetry this...
SQL> with rt as
2 (select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
3 (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12)),
4 xx as
5 (select '06/25/2007' vdate, 100 vamount from dual union all
6 select '06/27/2007', 200 from dual union all
7 select '07/04/2007', 400 from dual)
8 select wk_no,sum(vamount) from
9 (select (select wk_no from rt where dt = to_date(vdate,'MM/DD/YYYY')) wk_no,vamount from xx)
10 group by wk_no;
WK_NO SUM(VAMOUNT)
week1 300
week2 400
SQL>
SQL> select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
2 (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12);
WK_NO DT Day
week1 25-Jun-2007 Monday
week1 26-Jun-2007 Tuesday
week1 27-Jun-2007 Wednesday
week1 28-Jun-2007 Thursday
week1 29-Jun-2007 Friday
week1 30-Jun-2007 Saturday
week1 01-Jul-2007 Sunday
week2 02-Jul-2007 Monday
week2 03-Jul-2007 Tuesday
week2 04-Jul-2007 Wednesday
week2 05-Jul-2007 Thursday
. -
How to create a report in bex based on last data loaded in cube?
I have to create a query with predefined filter based upon "Latest SAP date" i.e. user only want to see the very latest situation from the last load. The report should only show the latest inventory stock situation from the last load. As I'm new to Bex not able to find the way how to achieve this. Is there any time characteristic which hold the last update date of a cube? Please help and suggest how to achieve the same.
Thanks in advance.Hi Rajesh.
Thnx fr ur suggestion.
My requirement is little different. I build the query based upon a multiprovider. And I want to see the latest record in the report based upon only the latest date(not sys date) when data load to the cube last. This date (when the cube last loaded with the data) is not populating from any data source. I guess I have to add "0TCT_VC11" cube to my multiprovider to fetch the date when my cube is last loaded with data. Please correct me if I'm wrong.
Thanx in advance. -
Get value based on the previous segment value
Dear all brothers,
In the entry form of SIT i want to retreive a value depends on the previous value, i know that "$FLEX$.value_set_name" is used for this but for example:
if the first segment is entered date and i want to get the second segment as the person grade within this date "in the first segment", what should i do for this ?
BTW, it is working fine in core apps using fffun.cd function , but not fine at all in the SSHR.
Regards,No help :( ??
-
Choosing a value based on newest date, and newest value
Good Afternoon,
I'm in search of help on a statement Im trying to perform in a Query transform in my ETL. So this is the scenario. I have a Value called SGSGVL which is "CYW" and in our descriptions table for the VALUE CYW we have 3 different Descriptions like Cadium Yellow, Cadium Yellow Paint and CDM Yellow and the date the description was added. What I would like to do is say:
Where in the description table = CYW, select the newest date and the most used value.
I've been told I can use a MAX statement but Im unsure exactly how to perform this in the query transform. Can anyone help? It would be GREATLY appreciated!
Thanks!You won't be able to do what you are asking in one query transform - it is complicated due the fact that you need your "max" to be based on something other than the column you want returned (date and count, versus the description). Essentially, what you need to do is:
QUERY1: value, description, field named REC_CNT with mapping of count(*), field named MAX_DATE with mapping of max(date), group by value and description
QUERY2: reads from QUERY1 --> value, field named MAX_REC which has a mapping such as: max(lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD')), and group by value only
QUERY3: also reads from QUERY1 --> value, description, field named THIS_REC which has mapping such as: lpad(REC_CNT,'0',5) || '_' || to_char(date,'YYYYMMDD'), no group-by
QUERY4: joins QUERY2 and QUERY3 on QUERY2.MAX_REC = QUERY3.THIS_REC. Pull the value and description from QUERY3.
Basically - QUERY2 gives you the list of records which are considered the max, and QUERY3 gives you the full list with the same column to be able to join on, so QUERY4 pulls the descriptions only for the max record.
-Trevor -
X-axis values - Set values based upon constant date
I am creating a line graph. I am plotting based upon date/time. I'd like to use a constant date across the x-axis. IE 8:00, 8:15, 8:30. Within the constant value there could be many points or no points. For example there could be a point at 8:01, 8:02, 8:05 and then a point at 8:35. Along the x-axis the label should remain constant at 8:00, 8:15...
Any ideas?Hi,
use the chart engine for creating your graph. When requiring a horizontal time axis you have to use the chart type TimeScatter.
Download the SAP Chart Designer (SDN - Downloads - WebAS) and see the included pdf document that describes how to structure your data XML.
Demo reports are GRAPHICS_GUI_CE_DEMO and GRAPHICS_IGS_CE_TEST.
Regards, Kai -
Get value based on column names for custom metadata field of Webcenter Content
In UCM, I created a custom metadata field of type Text. I then enabled optlist in that field. I populate values to the optList, I am using a View. The View has three columns. Let us call them ID, Key, Value. OptList displays the Keys in its list. I then create a Content (Content ID: MyContent) in Webcenter Content and choose values from OptList for my new metadata field (MyField).
From Webcenter Portal, I am populating a selectOneChoice with values of MyField in the Content ID: MyContent. Remember from previous step, the values populated in selectOneChoice is the list of values selected from optList field MyField. This optList is in-turn populated from View. After the user selects a value in selectOneChoice, in Javascript, I need to alert a message in this format "value chosen - corresponding value from View of optList that populates MyField"
I think an example will be useful:
Here is a View that I created in Configuration Manager applet in Admin Applets of Webcenter Content:
ID | State | Capital
1 | North Carolina | Raleigh
2 | California | Sacramento
3 | Illinois | Chicago
Then, I create a Custom Field (Name: MyField). MyField is an optList the values are populated from View created above. The internal value and display value are both State. Then I Check-In a new content with Content Id: MyContent. For MyContent, I select these values from OptList for MyField: {North Carolina, Illinois}.
In my Webcenter Portal application, I create a Content Presenter Taskflow. I configure it as a single item content presenter. I assign MyContent as Content Id. Then, in templateView, I get all values of MyField in MyContent and display them as selectOneChoice. I created a javascript function that would get the value that user selected in selectOneChoice. In the View created in Webcenter Content's Configuration Manager (above), there is a value corresponding to each value displayed. So, for the selected value, I need to get the corresponding Capital and display it in my alert message.
From Javascript, how can I get the value of Capital, given I have the value of State.Hi.
The idea to achieve your requirement is next:
Create a helper manage bean that will be call as Map access: #{stateUtil['Calofironia']} (it will return Raleigh). This value will be get calling GET_SCHEMA_VIEW_VALUES IDC service using RIDC in your manage bean.
Pass the result of #{stateUtil['statename']} to your JavaScript function using <af:clientAttribute.../>
I hope this information help you.
Regards, -
Get values based on Dropdown box selection-Important
Hi All,
In first table, i have an two textfields one is for "item no" and other is "item desc" and in the second table I have an "dropdown box" and "item desc".
Whatever is entered in the "item no" its populating in the "dropdown box", when an dropdown is selected any item that item desc should be displayed.
For example: In first table
Item no Item Desc
item 1 abc
item 2 def
item 3 ghi
and in the second table
Dropdown box Item desc
item 2 def
item 3 ghi
When am selecting item2 in dropdown box the related text is not getting dispalyed. And moreover the using instindex and the value is populating 0, below is the script
var Instindex = xfa.resolveNode("Page1.Subform1.Table1.Row2.Calculation").rawValue;
app.alert(Instindex);
var my_concatcomm = xfa.resolveNode("Page1.Itemtable.Table2.Row2[" + Instindex + "].EnterItemDescription").rawValue
var my_concatcomm = "Page1.Itemtable.Table2.Row2["+ 3 +"].EnterItemDescription"
app.alert("Index value::"+ xfa.resolveNode(my_concatcomm).rawValue);
Can anybody please help me on this.
Thank you for your help in advacneYes one more thing, i do not want any buttons or anyother webitem to be clicked to get this. this should be set with some commands if avilalbe or some other guess ?
-
Find latest value based on defined date
Hi all,
In my below example, I want to find the latest symptom and name which has been added after 24-mar-2012 (not before that) .Not getting proper output
with xx as
(select 101 as ID, 'A01' as name, '03/24/2012' as create_date from dual
union all
select 101, 'A01', '03/24/2012' from dual
union all
select 102 , 'A02', '03/24/2012' from dual
union all
select 101 , 'A01', '03/30/2012' from dual
union all
select 102 , 'A02', '03/30/2012' from dual
union all
select 102 , 'A01', '04/21/2012' from dual
union all
select 101 , 'A01','04/22/2012' from dual
xy as
(select 101 as ID, 'asthma' as symptom from dual
union all
select 101 , 'cancer' from dual
union all
select 101 , 'bpressure' from dual
union all
select 102, 'sbp' from dual
union all
select 101 , 'dbp' from dual
union all
select 102, 'allergy' from dual
union all
select 103 , 'cardiac failure' from dual
union all
select 102 , 'sneezing' from dual
select xx.name, xy.symptom, xx.create_date from xx, xy
where xx.id=xy.id
group by xx.name, xy.symptom, xx.create_date
having xx.create_date >'03/24/2012'Costa wrote:
Hi all,
In my below example, I want to find the latest symptom and name which has been added after 24-mar-2012 (not before that) .Not getting proper outputwhat does the proper output look like according to you?
1 with xx as
2 (select 101 as ID, 'A01' as name, '03/24/2012' as create_date from dual
3 union all
4 select 101, 'A01', '03/24/2012' from dual
5 union all
6 select 102 , 'A02', '03/24/2012' from dual
7 union all
8 select 101 , 'A01', '03/30/2012' from dual
9 union all
10 select 102 , 'A02', '03/30/2012' from dual
11 union all
12 select 102 , 'A01', '04/21/2012' from dual
13 union all
14 select 101 , 'A01','04/22/2012' from dual
15 ),
16 xy as
17 (select 101 as ID, 'asthma' as symptom from dual
18 union all
19 select 101 , 'cancer' from dual
20 union all
21 select 101 , 'bpressure' from dual
22 union all
23 select 102, 'sbp' from dual
24 union all
25 select 101 , 'dbp' from dual
26 union all
27 select 102, 'allergy' from dual
28 union all
29 select 103 , 'cardiac failure' from dual
30 union all
31 select 102 , 'sneezing' from dual
32 )
33 select xx.name, xy.symptom, xx.create_date from xx, xy
34 where xx.id=xy.id
35 group by xx.name, xy.symptom, xx.create_date
36* having xx.create_date >'03/24/2012'
SQL> /
NAM SYMPTOM CREATE_DAT
A01 cancer 04/22/2012
A01 bpressure 04/22/2012
A01 bpressure 03/30/2012
A01 allergy 04/21/2012
A01 asthma 03/30/2012
A01 sbp 04/21/2012
A01 sneezing 04/21/2012
A02 sneezing 03/30/2012
A01 asthma 04/22/2012
A01 cancer 03/30/2012
A02 sbp 03/30/2012
NAM SYMPTOM CREATE_DAT
A01 dbp 04/22/2012
A01 dbp 03/30/2012
A02 allergy 03/30/2012
14 rows selected.
SQL>
Maybe you are looking for
-
Integration server information isn't updated
Hi In SLD ->Technical System ->Process Integration, the update date of Integration Server have not been updated otherwise restart SAP instance. regards,
-
Error on standard RKKBCAL2 program
Hi Friends, We have one standard program RKKBCAL2 in this report Material cost value was not shows the correct values, Any one plz suggest me the note No's Thanks in advance,
-
How to get notified when new java SE update is released
We need to track security and performance bug fixes and features introduced in each new Java release that comes out. Is there a linked that we can monitor or feed that updates us when a new java version comes out? Do we need a support contract to re
-
Does it work with Sky modem/router?
Hi folks, does the airport express base station work with Sky broadband? I want to connect the base station to my router via ethernet cable (in 2 different rooms) and use it to extend my wireless range, and print wirelessly. Anybody done this with th
-
How do you keep Pages icon in dock?