Urgent: Formular question: get first/last month value with qty value
We've got a query result as the following:
Jan_2007 -- Feb_2007 -- Mar_2007 -- Apr_2007
0 --- 54 --- 0 --- 3
23 ---0 --- 12 --- 7
In the above query result,
1st row shows the sales quantity in Jan_2007 is 0, in Feb_2007 is 54, in Mar_2007 is 0, and in Apr_2007 is 3.
2nd row shows the sales quantity in Jan_2007 is 23, in Feb_2007 is 0, in Mar_2007 is 12, and in Apr_2007 is 7.
We would like to add a new column to get the first/last month value with quantity, e.g., in 1st row, the 1st month value with quantity value (>0) is Feb_2007, and the last month value with quantity value (>0) is Apr_2007. Therefore the 1st month value with qty is Feb_2007 and the last month value with qty is Apr_2007. In 2nd row, the first month value with qty is Jan_2007 and the last month value with qty is Apr_2007. But how to use formular to get the 1st/last month values with qty?
We will give you reward points!
Hello Kevin,
You can create forumula using [Boolean Operator|http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]
IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
You can also use the [AND, OR Logical operators |http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm]to check all the keyfigure columns.
Thanks
Chandran
Similar Messages
-
How can I compare single value with multiple value...
Hello,
I want to compare one value with multiple values, how can it possible ?
Here in attachment I tried to design same logic but I got problem that when I entered value in y that is compared with only minimum value of x, I don't want that I want to compare y value with all the x value and then if y is less then x while loop should be stop.
I want to do so because in my program some time I didn't get result what I want, for example x values is 4,5,6,7,8 and y value is suppose 6 then while loop should be stop but here it consider only minimum number and its 4 here so while loop is not stop even y is less then 7 and 8. So I want to compare y value with all the entered values of x and if y is less then any of x values then while loop should be stop and led should be ON.
Please guide me how can I do so.....
Solved!
Go to Solution.
Attachments:
COMPARISON.vi 8 KBAnkitRamani wrote:
Thank you very mach for your help..
may be i have solved this ....i have made one change in my vi that instead of min. i select max and max. value is compare with the value of y and then if y is less then the max. while loop will be stop other wise its run continuously.
this is working fine...
any ways thanks again for your help and time...
I have to agree with Lewis - his way is more efficient.
Bill
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all. -
How to compare single value with multiple values
In my query I have something like this:
A.SOR_CD=B.SOR_CODE where A and B are 2 different tables. This condition is in the where clause. The column in table A has single values but some values in table B have multiple comma separated values (822, 869, 811, ..). I want to match this single
value on the left side with each of the comma separated values. Please let me know how will I be able to do it. The number of comma separated values on the right side may vary.Hi MadRad123,
According to your description, you want to compare single value with multiple values in your query. Right?
In this scenario, the table B has comma separated values, however those comma separated values are concatenated into a string. So we can use charindex() function to return the index of the table A value. And use this index as condition in
your where clause. See the sample below:
CREATE TABLE #temp1(
ID nvarchar(50),
Name nvarchar(50))
INSERT INTO #temp1 VALUES
('1','A'),
('2','A'),
('3','A'),
('4','A'),
('5','A')
CREATE TABLE #temp2(
ID nvarchar(50),
Name nvarchar(50))
INSERT INTO #temp2 VALUES
('1','a,A'),
('2','A,B'),
('3','c'),
('4','A,C'),
('5','d')
select * from #temp1 a inner join #temp2 b on a.ID=b.ID
where CHARINDEX(a.Name,b.Name)>0
The result looks like below:
Reference:
CHARINDEX (Transact-SQL)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
How to compare dropdown pre value with post value in sharepoint designer list workflow
How to compare dropdown pre value with post value in sharepoint designer list workflow
Hi,
Can you provide more details about your requirement? It would make others easier to find a solution for you.
By default, a workflow will be triggered after submitting data in the NewForm or EditForm.
If you want to monitor the value changed in a drop down menu which is supposed to be in NewForm or EditForm, it would be more appropriate to apply custom JavaScript in the NewForm
or EditForm page.
About how to detect the value changed using JavaScript, the demos in this thread would be helpful:
http://stackoverflow.com/questions/12080098/dropdown-using-javascript-onchange
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
User exit or BADI to validate service request value with PO value
Dear gurus,
Is there any userexit or BADI to validate service request value with PO value. Please help me regarding this.
Thanks in advanceHi,
Please check these enhancements (SMOD) for user exits available of transaction ML81N.
SRV_FRM - SRV: Formula calculation (obsolete since 4.0A!)
SRVSEL - Service selection from non-SAP systems
SRVREL - Changes to comm. structure for release of entry sheet
SRVQUOT - Service export/import for inquiry/quotations
SRVPOWEB - Purchase order for service entry in Web
SRVMSTLV - Conversion of data during importing of standard service cat.
SRVMAIL1 - Processing of mail before generation of sheet
SRVLIMIT - Limit check
SRVKNTTP - Setting the account assgnmt category when reading in, if "U"
SRVEUSCR - User screen on entry sheet tabstrip
SRVESSR - Set entry sheet header data
SRVESLL - Service line checks
SRVESKN - Set account assignment in service line
SRVESI - Data conversion entry sheet interface
SRVENTRY - Unplanned part of entry sheet (obsolete since Rel. 3.1G)
SRVEDIT - Service list control maintenance/display)
SRVDET - User screen on tab strip of service detail screen
INTERFAC - Interface for data transfer
Regards,
Ferry Lianto -
Book revenue on this month but the cost of goods sold need to get from last month
Hi experts,
I have a question about cost and revenue. We have a standing service repair order and a contract to customer. Because the revenue is calculated by flight cycle so maybe when we get the flight cycle information for this month should be the midle of next month. Due to the monthly end close schedule I need to book the revenue on this month but the cost of the revenue we need the get the cost occur last month. For example, current month is May, 2014 and I book the revenue and posting date is May, 31, 2014. But the cost I just want the amount occurred in customer service order(IW31) on Apr, 2014. And the cost occured in May, 2014 should become WIP. Is it possible? Please advise.
Thanks and Best Regards,Hi experts,
I have a question about cost and revenue. We have a standing service repair order and a contract to customer. Because the revenue is calculated by flight cycle so maybe when we get the flight cycle information for this month should be the midle of next month. Due to the monthly end close schedule I need to book the revenue on this month but the cost of the revenue we need the get the cost occur last month. For example, current month is May, 2014 and I book the revenue and posting date is May, 31, 2014. But the cost I just want the amount occurred in customer service order(IW31) on Apr, 2014. And the cost occured in May, 2014 should become WIP. Is it possible? Please advise.
Thanks and Best Regards, -
How to get first of month?
Hey,
I have got variable date - f.ex. 2009-09-09
I use sth like this to get 1st of month:
to_date(to_char(to_date('2009-09-09', 'YYYY-MM-DD'), 'YYYY-MM') || '-01', 'YYYY-MM-DD')
Can I get date like this faster?Hi,
use TRUNC(your_variable_date, 'mm').
Example using a DATE:
MHO%xe> select trunc(sysdate, 'mm') from dual;
TRUNC(SYSDATE,'MM')
01-10-2009 00:00:00Using a STRING:
MHO%xe> select trunc(to_date('2009-09-09', 'YYYY-MM-DD'), 'mm')
2 from dual;
TRUNC(TO_DATE('2009
01-09-2009 00:00:00 -
How to get all parameter names along with their values in stored procedure which is being executed
Im using sql server 2012, is there any possible way to get all the parameters of a stored procedure along with the values passed to it.
I need these things to build a xml. I mean this should happen in the procedure which being executed and it should be common for all the procedures.
For example, let us suppose we have to procedures,
uspSave, @name='test' @age=20
uspDelete @id=2
now in uspSave procedure, i need to get @name, @age and the values 'test', 20 and in uspDelete, i should get @id with value 2.
For getting the column names, i tried this,
select parameter_name from information_schema.PARAMETERS where specific_name=OBJECT_NAME(@@procid)
now is it possible to loop through the result of above query and can we get the values.I think you need running SQL Server Profiler to capture this info even in SQL Server 2012.
Best Regards,Uri Dimant SQL Server MVP,http://sqlblog.com/blogs/uri_dimant/
Blog : MS SQL Development and Optimization
Blog : Large
scale of database and cleansing -
Report on Open Items along with Qty & Value for LA confirmed items
Hi,
I would like to know a report of Open POs(No Goods receipt made) but LA confirmed Items along with Values(Amount)
i.e
List of confirmed,unsent items along with Values for plant wise or vendor wise or PO Number wise.
Regards,
VengatHi,
Any other inputs?
Our client's requirement is to know how many (Both Qty & Value) of items for the input LA confirmed(ASN received) but no GR Made
Regards,
Vengat -
Compare current value with previous value
Hello,
I would like to compare the current value with the previous value of the current value.
How can I solve this problem?
MauritsHi,
after going through the basics course you surely can understand that example:
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Comparing GL Actual Values with BUDGET Values
Hi All,
Do we have any report in SAP, to Compare GL Actual Balances with BUDGET Values.
Regards,
VenkatHello,
In General Ledger accounting, there is no budgetary control is available.
Refer Internal Order Accounting or Project System or Funds Management for budgetary control.
Regards,
Ravi -
Two questions: getting first iPhone & deleting old iPhone backups?
Here's the deal.
My neighbor has 'paid' for his old iPhone 4 through AT&T and is getting a new one. He's going to give me his old one. It will be my first smartphone (and, naturally, my first iPhone). I've backed it up for him using my computer before and there are a bunch of his apps in iTunes which I would like to remove. So my first question is, "how do I get rid of that backup"?
I've downloaded the iPhone 4 manual with iOS 4.x (which he has running) and I think I know how to go about updating and resetting the phone. After I get it updated to iOS 6.x, I'll be going to the AT&T store and finding a good (cheap!) plan that fits my lifestyle.
Any help or suggestions?
Thanks,
ClintonOn the phone, follow the directions here:
http://support.apple.com/kb/HT5661
Then set things up using YOUR Apple ID. Any old backups, delete: iTunes>Preferences>Devices. Also delete any & all content, in your library, obtained with his ID. -
MDX dimension formula in BPC to get the previous month failed with parents
Hi,
I'm working on a proof of concept and I need to create a formula with the following requirement:
Requirement
Account2 = Account2 (Previous Month) + Account 1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85___140 <== OK
Now, I was thinking of applying this formula within Dimension, using MDX. Then I tried with these two examples, but they didn't work when rolling up to parents. I mean, the calculation for every month works fine, but, the Total Quarter or the Total Year are wrong:
Attempt 1:
Account2.Formula = (ParallelPeriod([Time].[Month], 1, [Time].CurrentMember), Account2) + Account1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85____85 <== WRONG
Attempt 2:
Account2.Formula = (Account2,[Time].PrevMember) + Account1
Accounts -Jan-Feb-Mar-Q1
Account1_____15___25___45____85
Account2_____15___40___85____85 <== WRONG
How can I solve this ? Should I use Script logic instead of MDX to perform this calculation ?
Thanks!
Diego.DON'T use MDX script logic. It does not perform well under high data volumes or concurrency.
You're calculation can be done easy enough in SQL logic provided you scope the code correctly. Based on what you have given as requirements, the basic code would be something like:
*XDIM_ADDMEMBERSET TIME = PRIOR
*XDIM_ADDMEMBERSET ACCOUNT=A2
*WHEN ACCOUNT
*IS "A1"
*REC(EXPRESSION=%VALUE%+GET(ACCOUNT="A2",TIME=PRIOR),ACCOUNT=A2)
*ENDWHEN
*COMMIT
The first two lines make sure you have the prior period values for A2 in the scope of exection. Then when a record for A1 comes through, it would take that value and add it to A2's prior value for the exact same intersection of all other dimensions. You would separately have to deal with moving forward values of A2 if there were cases where you could have a value for A2 in a prior period but not have a value in A1 for the current period.
Edited by: James Sharrett on Apr 14, 2008 9:51 AM -
Question regarding creation of xml-elements with numerical values
When i create xml-documents from xml stored in the database (xmltype table based on an xml-schema), i find that numerical values which were stored as 0.395 (with the "." as the decimal separator) are retrieved as .395.
Is it possible to apply a format mask so that the numerical value is retrieved as 0.395?
thanks, Bart
N.b. Note that i select a complete xml-fragment. So my problem seems related to the storage or retreival of 'schredded' XML. I do not use SQL/XML-functions with relational data, in which case i know how to apply a format mask.I don't use XSLT, i just query the XML-documents stored in an XMLType column with a simple SQL-statement.
I have posted a simple example over here Re: Is it possible to influence the creation of empty elements? -
Replacing the old value with new value on the website
Hi ,
I have two input fields CLIN # and PR#.When i enter the text,for the first it is working fine,second time when i enter it is replacing the value which i enter with the first one.I should not replace the old value.
ex:
Example when i enter test5 for the first time
CLIN # :Test 5
Next when i enter Test6 ,this value replaces the first one
CLIN#: Test6
CLIN#:Test6(there is no test5)
I am doing for my istore application.Any ideasAs the user that created the anonymous block ruun:
select count(*) from general_acct_mast_table;
and
select tbaadm.count(*) from general_acct_mast_table;I strongly suspect that they are actually two different tables, and the tbaadm version is substantially larger that the non-qualified one.
In any case I would not be doing this as a row-by-row procedure. I would create two lookup tables like:
create table masked_general as
select acid, foracid, round(dbms_random.value(81000000,85000000)) masked
from (select distinct acid, foracid
from general_acct_mast_table
where acct_ownership not in ('O'));
create table masked_stmnt as
select * from masked_general;
alter table masked_general add constraint masked_general_pk
primary key (acid);
alter table masked_stmnt add constraint masked_stmnt_pk
primary key (foracid);Then do the updates as:
update (select g.foracid, g.acid, gm.masked
from general_acct_mast_table g
join masked_general gm
on g.acid = gm.acid)
set foracid = masked;
update (select s.foracid, sm.masked
from mini_stmnt_details_table s
join masked_stmnt sm
on s.foracid = sm.acid)
set foracid = masked;Note that this assumes that both acid and foracid are individually unique in general_acct_mast_table, which seems to be implied by your procedure, and that you want to be able to roll the whole thing back if there are problems (that is, you do not want to commit between the update of general_acct_mast_table and mini_stmnt_details_table).
I would also probably a a verification step after creating the first masked table to ensire that you did get unique vluaes back fo the masked column.
John
Maybe you are looking for
-
Replacing System hard drive with a new one. How to get everything over to the new boot drive? Should I use Carbon Copy or does apple have a better untility to do this? I can't get my current system drive (OSX 10.8.3) to start on the first try. I alwa
-
Error in selection of cardinality
Dear Techies, I have a few gliches in understanding Cardinality. I have a input field and a submit button on my view. So i decided to use a node under which an attribute is binded to the input field in the view. The user may enter or may not ente
-
Satellite C660-1fv - no webcam
hello everyone, i am new here and dont know how to make a post at the site so i am writing here! i have a toshiba satellite c660-1fv and just made a format at the laptop i install all drivers except th webcams because i cant i try a lot of time a lot
-
Hi When researching a backup policy for my server I have noted that apple apparently provides som tools for this. More specifically in /Applications/Server.app/Contents/ServerRoot/usr/sbin/ one can find the application/script ServerBackup. There is a
-
I have a MBP with 10.6 that is printing images to large. By printing too large, I mean that the image of the page is being blown up too big - text is way too large and elements of the page are being cut off. This happens especially with web pages. No