Message Mapping, First and last values in a CSV file
I'm having problems with a Message Mapping that requires me to take the values from the first line in a CSV and the last line to calculate other values...
The source message type in my mapping is as follow
<MT_Message>
<Header> 1..1
<ID>
<StartDate>
<EndDate>
<Records> 1...unbounded
<Interval>
<Number>
I need to take the first row/occurence of Records and use this to calculate the Startime. I also need to take the last occurence of Records to calculate the stop time
This is my CSV file content
H FORECASTS 20080101 20081231 17568
D 20080101 1 1 66.29283
D 20080101 1 2 61.1344
D 20080101 2 1 61.1344
In this case I need to take the values 1 1 for the StartTime and 2 1 for the StopTime.
How can this be done?
Damien,
Do u have problem with mapping or content conversion. According to my understanding the problem is with content coversion. U can't take the first and last values in CSV file. Probably u can import all the values and during mapping u can seggregate the required structure alone.
Best regards,
raj.
Similar Messages
-
First and last values of this month
Hi ,
In my reporting I want to calculate average value based on amount.
Avg = ( Starting amount of this month + Ending amount of this month) / 2.
How can i get the starting value and ending value for one field "Amount".
I changed the <b>amount</b> properties as Sum, Last value and based 0calday.
but for the same amount how can I get the starting value.
(NOTE: Starting value is not equal to the last month last value).
The data is coming based on day wise.
Suggest me ...
Thanks in advance....
Regards
RajeshDear Rajesh,
Can you tell me which cube you are working with, and what is the key figure ?
What you can do is have a RKF which will have a selection variable for fiscal year period for the current month(which could be a user entry and mandatory entry).
Now create a copy of the above RKF and use a off set of -1 for the variable fiscal year period.
now the valu you get from the first RKF will be the month end balance and the value you get for the second RKF will be the closing balance of previous month, which is nothing but the opening for the user inputed month.
Now you can create a CKF to get the average.
Hope the above helps, If yes please assign reward points
regards
Venkata Devaraj -
How to capture the data within the given range of maximum and minimum values ? from csv files
My requirement,
1. Here, the user will provide the range like maximum and minimum values, based on this range, the VI should capture the data within the given range. ( from CSV file as attached )
2. Then VI should calcluate the average value for captured data and export it to excel.
This is my requirement can anyone help me on this.
Many thanks in advance
rc_cks
Attachments:
sample_short.csv 2439 KBHi,
Thanks for remnding me. I forgt to attach the VI,
Here I am attaching the VI, what I tried.
From attached CSV file, I have to find an average value for columns B,C,D,E,F,G,H,I and AJ, AK. ( data range will be defined by user ), focused only on these columns
Here, the scope is to calculate an average value for given data range by user as MAX and MIN data.
FYI: I tried manually for two instance i.e column H & I. As per H column one steady state values from 7500 to 10500 and similarly in I column 7875 to 10050. So, I gave these as a limit to capture and calculate the average value. But unfortunaltely, requirement has been modified as per below requirements.
More Info on requirement:
--> The user will define the range of data by giving some MAXIMUM and MINIMUM values(for above mentioned columns induvidually), then VI should capture that data range and it has to caculate the average value for that range of data. This is the task I have to complete.
--> I am stuck in creating a logic for data capturing for given range of MAX and MIN value from user,
Can anyone help me on this.
If my explanation is not clear, Please let me know.
Many thanks, help mw
rc
Attachments:
VI_rc.vi 25 KB
sample.zip 4166 KB -
TSQL Query to display First and Last Values of a GROUP as Columns - SQL Server 2008
Could someone please help with the TSQL to achieve the following: Every Employee has 2 records (From & To). Output has to display one record for each employee with From & To as columns.
Input
Empid
Type
Date
100
From
5/4/2004
100
To
6/2/2008
101
From
6/12/2003
101
To
6/2/2013
102
From
12/12/2012
102
To
5/3/2014
Output
EmpID
From
To
100
5/4/2004
6/2/2008
101
6/12/2003
6/2/2013
102
12/12/2012
5/3/2014
Thanks, Ashish SinghSELECT empid,
MAX(CASE WHEN Type='From' THEN date END) from,
MAX(CASE WHEN Type='To' THEN date END) to
FROM tbl GROUP BY empid
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Set first and last "X" values of array to a value
If I have a 1D DBL array, how can I set the first and last (e.g.) 100 values to, say, 0?
I can think of doing a for loop for both the first and last segments, but wonder if there's a more elegant way.
Solved!
Go to Solution.OK here is the first 100 and last 100. I didn't read that the first time.
Message Edited by aeastet on 03-16-2010 05:08 PM
Tim
Johnson Controls
Holland Michigan
Attachments:
Example.vi 8 KB -
How do I easily select a group of emails in Apple Mail if I want to delete them? In other words, what do I select if I mark the first and last email to delete everything in between? Thanks.
I have this same issue. I have over 100 email addresses that I need to add to a group. The issue is not making the group, it's getting the email addresses from Mail to Contacts.
Dragging the email addresses does nothing. You can copy the addresses, but there's nowhere to put them. You can make a VCF for an email address, but then you have to find all of them to add them to the group. How do you automate this?!
I'm astounded that there's so little support for such a common issue for which people have been asking for years. -
How to get first and last date of previous month
To set default values in selection screen,I want first and last date of the previous month.
Also I want the first and last dates of previous quarter.
The quarters can be only january to march, apr to june, jul to sept, oct to dec.
I want to run a program on beginning of each month by job scheduling having <b>selection screens</b> for the above monthly and quarterly dates.Hi Suhas,
Use the below code.
DATA: v_date LIKE sy-datum.
DATA: v_month_begin_date TYPE sy-datum,
v_month_end_date TYPE sy-datum,
v_month(2) TYPE n,
v_month1(2) TYPE n,
v_quarter TYPE i,
v_year(4) TYPE n,
v_quarter_begda TYPE sy-datum,
v_quarter_endda TYPE sy-datum.
v_month = sy-datum+4(2).
IF v_month = '01'.
v_month = '12'.
v_year = sy-datum+0(4) - 1.
ELSE.
v_month = v_month - 1.
v_year = sy-datum+0(4).
ENDIF.
CONCATENATE v_year v_month '01' INTO v_date.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = v_date
IMPORTING
ev_month_begin_date = v_month_begin_date
ev_month_end_date = v_month_end_date.
v_month1 = sy-datum+4(2).
IF v_month1 = '01' OR
v_month1 = '02' OR
v_month1 = '03'.
v_quarter = 1.
ELSEIF v_month1 = '04' OR
v_month1 = '05' OR
v_month1 = '06'.
v_quarter = 2.
ELSEIF v_month1 = '07' OR
v_month1 = '08' OR
v_month1 = '09'.
v_quarter = 3.
ELSEIF v_month1 = '10' OR
v_month1 = '11' OR
v_month1 = '12'.
v_quarter = 4.
ENDIF.
IF v_quarter = 1.
v_quarter = 4.
v_year = sy-datum+0(4) - 1.
ELSE.
v_quarter = v_quarter - 1.
v_year = sy-datum+0(4).
ENDIF.
CALL FUNCTION 'HR_99S_GET_DATES_QUARTER'
EXPORTING
im_quarter = v_quarter
im_year = v_year
IMPORTING
ex_begda = v_quarter_begda
ex_endda = v_quarter_endda.
WRITE:/5 'previous month begin date : ', v_month_begin_date.
WRITE:/5 'previous month end date : ', v_month_end_date.
WRITE:/5 'previous quarter begin date : ', v_quarter_begda.
WRITE:/5 'previous quarter end date : ', v_quarter_endda.
Message was edited by:
Velangini Showry Maria Kumar Bandanadham -
How can I display the first and last name using a paramater as employee ID?
Hi SAP,
I have a parameter that is called {? Employee ID}. What I want to do is display the first and last name based on the employee ID value entered in {? Employee ID} in the page header of the report. Right now, when I put the following formula in the page header only some pages get the right result while other pages dont....
if table.employeeid = {? Employee ID} then
table.firstname" "table.lastname
It appears as though if the first record in the details section on the beginning of each page happens to be the employee under {? Employee ID} then it prints it correctly, if it isn't I get a null value in the page header.
Anyone have any ideas?
ZHi Try this,
Whileprintingrecords;
if ={?EmpID} then
Also check the option "Default values for null" in the formula editor.
Regards,
Vinay -
Get First and last day of Month..
Hi Friends,
I am trying to fetch First and Last day of a month and would like to implement that in the following code:
SELECT COALESCE(Date_A, Date_B, Date_C)
FROM dual
Here Date A and B are in Format of MM DD YYYY (March 14, 2008)
and Date C is like MM YYYY (March 2008)
How can I get the Date_C as March 1, 2008 OR March 31, 2008 format if Date A and B are NULL ?
Thanks!
Edited by: user11095386 on Apr 23, 2009 10:45 AMHi,
In my earlier message, I thought that you were starting with strings like '03 12 2009' and that you wanted to display them as 'March 12 2009'. If what you have is just the reverse, then just reverse the format strings in my first message. Add a comma, if you want one, in the appropriate format string.
I believe this is what you want:
COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY')
, TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY')
, TO_CHAR ( TO_DATE ( Date_C, 'fmMonth YYYY'), 'MM DD YYYY')
)Notice how, on the 3rd line, TO_DATE is called without DD in the format string:
TO_DATE ( Date_C, 'fmMonth YYYY')When you do this, the day defaults to the 1st of the month, so this is all you have to do to convert the VARCHAR2 'March 2009' to the DATE 01-Mar-2009.
If you want the last day of the month, not the first, when Date_C is chosen, then use LAST_DAY:
COALESCE ( TO_CHAR ( TO_DATE ( Date_A, 'fmMonth DD YYYY'), 'MM DD YYYY')
, TO_CHAR ( TO_DATE ( Date_B, 'fmMonth DD YYYY'), 'MM DD YYYY')
, TO_CHAR ( LAST_DAY ( TO_DATE ( Date_C
, 'fmMonth YYYY'
, 'MM DD YYYY'
) -
Getting first and last day of week
Dear all .
Is there any funcion module which gives first and last day of the current week .
Eg . todays day is 15.11.2006
start date of week : 13.11.2006
end date of week : 19.11.2006
in the same way I want how many days are there in month .
Eg : for Nov month :
30 days .
for dec month 31 days .
Thank you in advanceUse FM GET_WEEK_INFO_BASED_ON_DATE
Import parameters Value
DATE 15.11.2006
Export parameters Value
WEEK 200646
MONDAY 13.11.2006
SUNDAY 19.11.2006
Use FM HR_E_NUM_OF_DAYS_OF_MONTH
Import parameters Value
P_FECHA 15.11.2006
Export parameters Value
NUMBER_OF_DAYS 30
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers -
Java 1.6.0_05 does not recognize first and last property in jnlp file
Hi
Has anybody else seen this?
The jnlp file contains five properties, but the JRE does not recognize the first nor the last property.
It has been working great since 1.4.2, through 1.5 and 1.6 until 1.6.0_05.
<property name='bog' value='%2fdata%2fkirkeboeger1892%2f'/>
<property name='opslag' value='aa001/AB/007/0000a-A.Jpg,aa001/AB/007/0002a-F.Jpg,... </property>
<property name='sessionId' value='ed0l5n55yu2h04alvqxdpbn3'/>
<property name='service' value='http://ao.sa.dk/LAView/ImageServer/Service1.asmx'/>
<property name='titel' value='1908+-+1924%2c+Agerskov%2c+N%c3%b8rre+Rangstrup%2c+Haderslev'/>The 'opslag' property is much longer, so I cut it off to make it more readable.
Pressing 's' in the console gives me this
Dump system properties ...
awt.toolkit = sun.awt.windows.WToolkit
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
http.auth.serializeRequests = true
https.protocols = TLSv1,SSLv3
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\Program Files\Java\jre1.6.0_05\lib\deploy.jar
java.class.version = 50.0
java.endorsed.dirs = C:\Program Files\Java\jre1.6.0_05\lib\endorsed
java.ext.dirs = C:\Program Files\Java\jre1.6.0_05\lib\ext;C:\Windows\Sun\Java\lib\ext
java.home = C:\Program Files\Java\jre1.6.0_05
java.io.tmpdir = C:\Users\MAJ-BR~1\AppData\Local\Temp\
java.library.path = C:\Program Files\Java\jre1.6.0_05\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jre1.6.0_05\bin;C:\Program Files\Mozilla Firefox;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;"C:\Program Files\Java\jre1.6.0_05\bin"
java.protocol.handler.pkgs = com.sun.javaws.net.protocol|com.sun.deploy.net.protocol
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.6.0_05-b13
java.security.policy = file:C:\Program Files\Java\jre1.6.0_05\lib\security\javaws.policy
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.6
java.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.6.0_05
java.vm.info = mixed mode, sharing
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 10.0-b19
javaplugin.proxy.config.type = direct
javawebstart.version = javaws-1.6.0_05
jnlpx.heapsize = 64m,128m
jnlpx.home = C:\Program Files\Java\jre1.6.0_05\bin
jnlpx.jvm = "C:\Program Files\Java\jre1.6.0_05\bin\javaw.exe"
jnlpx.remove = false
jnlpx.splashport = 49557
line.separator = \r\n
opslag = aa001/AB/007/0000a-A.Jpg,aa001/AB/007/0002a-F.Jpg,...
os.arch = x86
os.name = Windows Vista
os.version = 6.0
path.separator = ;
service = http://ao.sa.dk/LAView/ImageServer/Service1.asmx
sessionId = ed0l5n55yu2h04alvqxdpbn3
sun.arch.data.model = 32
sun.boot.class.path = C:\Program Files\Java\jre1.6.0_05\lib\resources.jar;C:\Program Files\Java\jre1.6.0_05\lib\rt.jar;C:\Program Files\Java\jre1.6.0_05\lib\sunrsasign.jar;C:\Program Files\Java\jre1.6.0_05\lib\jsse.jar;C:\Program Files\Java\jre1.6.0_05\lib\jce.jar;C:\Program Files\Java\jre1.6.0_05\lib\charsets.jar;C:\Program Files\Java\jre1.6.0_05\classes;C:\Program Files\Java\jre1.6.0_05\lib\javaws.jar;C:\Program Files\Java\jre1.6.0_05\lib\deploy.jar
sun.boot.library.path = C:\Program Files\Java\jre1.6.0_05\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
sun.desktop = windows
sun.io.unicode.encoding = UnicodeLittle
sun.java.launcher = SUN_STANDARD
sun.jnu.encoding = Cp1252
sun.management.compiler = HotSpot Client Compiler
sun.os.patch.level =
trustProxy = true
user.country = DK
user.dir = C:\Users\Maj-Britt\Documents
user.home = C:\Users\Maj-Britt
user.language = da
user.name = Maj-Britt
user.timezone = Europe/Paris
user.variant = As one can clearly see, the 'bog' and 'titel' (i.e. first and last) properties are missing, resulting (bad code - I know) in a NullPointerException.We also have this problem, but it's not first and last property.
We have 6 properties, and the 3. property is gone.
If I download the jnlp file, the property is there, if I choose show jnlp file in "javaws -viewer" it's not there. Only difference between this property and the working properties is length.
The length is char 255, and the data is base64 encoded.
I worked fine before upgrading to Java 6 update 5.
Anyone any ideas? -
Finding first and last members of a group set
Is there any example how to use 'first' and 'last' functions in an sql query ?
I have tried to execute a query like this on the scott.emp table :
select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
but I always get this message:
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier
btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
tx for your help
sjarifSyarif,
The FIRST and LAST functions, which became available with 9i, are used to find the first or last member of a ranked set. I'm not sure exactly what you are trying to do, but I can show you a query that should work (I don't have 9i handy at the moment). This query should give you the departments with the highest (first) and lowest (last) aggregate salaries:
select deptno,
min(deptno)
keep (dense_rank first order by sum(sal) desc) highest_sal,
min(deptno)
keep (dense_rank last order by sum(sal) desc) lowest_sal
from emp
group by deptno
Is there any example how to use 'first' and 'last' functions in an sql query ?
I have tried to execute a query like this on the scott.emp table :
select deptno,min(sal),max(sal),first(sal) from emp group by deptno;
but I always get this message:
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier
btw I use Oracle RDBMS ver 9.1.0.3 for Solaris in my server.
tx for your help
sjarif -
Displaying current user's first and last name on a report.
I would like to dispay the current user's name on a report. I've tried using User() and NQ_SESSION current user .
These two options display the User ID (i.e. User name is Jon Smith. there ID is COMP/JSMITH.
Using the two methods above the ID (COMP/JSMITH) is displayed. Is there a way I could display Jon Smith?
I thought their might be a way to use Full Name or First and Last Name.
Message was edited by:
user618827VALUEOF(NQ_SESSION.DISPLAYNAME) will do the trick
Mike L -
I need to build a linear list of the string positions of the
first and last character of each word in a string. For example if I
have the string myPet = “DOG CAT FISH” then myList =
[[1,3],[5,7],[9,12]]
myPet.word[x] will let me access the individual words but
I’m not sure how to get the char position of the beginning
and end of each. Please help, it’s Friday and my brain has
left for the weekend.Touche, Sean.
"Sean Wilson" <[email protected]> wrote in
message
news:fqa8ap$bga$[email protected]..
> Hi Craig,
>
> Your's fails if any word is repeated. Try it with "DOG
CAT FISH DOG"
>
> This one seems to work, although there are probably more
efficient ways to
> go about it. A regular expression and the PRegEx xtra
would certainly be
> quicker, especially as the string gets longer
>
> on mGetWordBoundaries aString
> -- basic error check
> if stringP(aString) = 0 then return []
> if length(aString) = 0 then return []
>
> lWhitespace = [SPACE, TAB, RETURN, numToChar(10)]
> tStart = 1
> tChar = aString.char[tStart]
> repeat while lWhitespace.getPos(tChar)
> tStart = tStart + 1
> tChar = aString.char[tStart]
> end repeat
>
> lPositions = []
> repeat with w = 1 to aString.word.count
> tEnd = tStart + aString.word[w].char.count - 1
> lPositions.append([tStart, tEnd])
> tStart = tEnd + 1
> tChar = aString.char[tStart]
> repeat while lWhitespace.getPos(tChar)
> tStart = tStart + 1
> tChar = aString.char[tStart]
> end repeat
> end repeat
> return lPositions
> end -
First and last analtic functions
Hi
I am trying to understand the functioning of first and last function. but getting not idea how they work.
doc says
FIRST and LAST are very similar functions. Both are aggregate and analytic functions that operate on a set of values from a set of rows that rank as the FIRST or LAST with respect to a given sorting specification. If only one row ranks as FIRST or LAST, then the aggregate operates on the set with only one element.
Can anyone help me to understand this by an example as small simple one
thanks
NickSQL> select max(sal) keep (dense_rank first order by empno) sal_max_first
2 , min(sal) keep (dense_rank first order by empno) sal_min_first
3 , max(sal) keep (dense_rank last order by empno) sal_max_last
4 , min(sal) keep (dense_rank last order by empno) sal_min_last
5 from emp
6 /
SAL_MAX_FIRST SAL_MIN_FIRST SAL_MAX_LAST SAL_MIN_LAST
800 800 1300 1300
1 rij is geselecteerd.The order by clause orders the fourteen employees such that the first one is 7369 - SMITH and the last one is 7934 - MILLER. The expression returns the salary of SMITH (800) or the salary of MILLER (1300). The min and max are dummy since there are no ties when ordering by the primary key (empno).
Regards,
Rob.
Maybe you are looking for
-
RH11 404 - Page Not Found when linking to PDF file from search results using IE9 and IE10
I'm using RH11 (11.0.3.268) and I've included a number of PDF files as baggage files. The hyperlinks on the pages work fine and display the PDF files in a separate window, as expected. However, when searching for these same PDF files using the Search
-
Best O/S for oracle apps 11.5.10.2 in windows family
Hi we are planning to implement apps 11i. Can you please recommend the best type of server to support Oracle application on Windows. For example, does Oracle App support both 64bit and 32bit or just 32bit? Where can i find this info.i googled but did
-
Java.lang.system and InputStream
java.lang.system has 3 fields defined: static PrintStream err; static InputStream in; static PrintStream out; As InputStream is a abstract class, can it be used to declare a variable? If so, how to instantiate? Thanks
-
Hello, I am opening a ASPX file together with it's CSS. I also have Visual Studio open in order to run the Development Server. for some odd reason every few times I refresh the browser in order to view my design changes DW04 crashes. this can happen
-
Problem with output / Data format
Using CFMX 7.0.2 Gupta SQLBase DB Here is my Query: <cfquery datasource="_Casewin" name="HomeData"> SELECT CRL_RLINE.RDESC, CRL_RLINE.QUESNO FROM CRL_RLINE WHERE CRL_RLINE.R_CASE = '#FORM.CASE_NO#' </cfquery> RDESC is a memo data type, but returns th