How to calculate some value that referring to another table
Hi...
Need help asap
The questions are :
Q1 : In Microsoft Excell, we can take value from one cell and use it to another cell.
How about in BO, if we want to take value (ex. 93.75) from the other table and use or refer the value that we want to to another table (just use the value from another table)
Just for information, we want to use the number (93.75) in another function. (if <93.75, then........) and the value (93.75) is a result from another function or calculation.
Q2 : How to SUM from one table and show the result to another table.(We want to use the result of SUM for another calculation in different table.)
Thanks for your kind help.
Eva,
In answer to your question about using a cell from report (block) as a value to be manipulated within another block, will be tricky unless you can employ the "Merge Dimensions" technique. Working in the blind and trying to visualize what you are trying to do is very difficult, so to speak in general terms, you will have to determine a best way to merge dimensions, then build specific local variables to "flag" and extract succinct values from one data provider, and then use that local variable in applying it to the other block. This will take some experimentation and testing before you can feel confident and get the hang of it.
On the other hand, if you know what the threshold value is that you want to apply (like for instance 91.75), then you can either "hardcode" that in your formula(s), or build a prompt in your report that captures this tidbit from the user when the report runs, and using the UserResponse function you should be able to calculate what it is you want to do.
Good luck and post more details (specific tables, columns, and manipulations) and perhaps some one can post a suggestion on how to best execute your report.
Thanks,
John
Similar Messages
-
SSRS How to pass subtotal value in matrix into another table just for display?
Hi all,
I have two matrix with subtotal for two grouping. I need to pass the value of this two group subtotal into another matrix table to display and perform simple calculation to get the differences.
How can I pass the subtotal amount into the other matrix?
In Crystal report I can define two variable where i can set the total to the value and call the two variable anywhere in the same report. But how can I do it in SSRS?
Appreciate can help
Thank youYes, basically both are same grouping, i just want to capture the subtotal for comparision with scenario 2.
I can do it in SQL, but if possible, I hope to do it in report. Thank you
Simulation as below
Matrix for scenario 1
Group 1
Detail
Detail
Subtotal Group 1
9999
group 2
Detail
Detail
SubTotal Group 2
8888
Matrix for scenario 2
Group 1
Scenario2
Scenario 1
Differences
Detail
Detail
Subtotal Group 1
2000
9999
2000-9999
group 2
Detail
Detail
SubTotal Group 2
3000
8888
3000-8888 -
How to calculate acquisition value for specified day
Hi,
in my z program I have a problem how to calculate acquisition value for my asset for specified day.
Example:
I have asset created 8.7.2008 with TTYPE 104 (External asset acquisition) with value 5950.
30.11.2008 there is another TTYPE 272 (Retirement of current-yr acquis., w/o revenue) with value 950.
So BEFORE 30.11.2008 acquisition value is 5950. After is 5000. Is there any function module (or something else) in SAP system where I can send asset number and date a it return to me acquisition value for that day?
Many thanks for any answer!Hi,
your suggestion means that I have to compute acquisition value by myself (sum all TTYPE 1** - sum all TTYPE 2**). So SAP does't provide such functionality (LDB ADA have it, because it can compute acquisitiob value for specific day)?
Mant thanks for answer -
How could I insert the deleted row into another table within a trigger?
Hi,
How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
CREATE TRIGGER delete_trigger
AFTER DELETE
ON test
FOR EACH ROW
BEGIN
-- How could I insert the deleted row into another table
END delete_trigger;
Message was edited by:
user569548Hi,
I'm not sure what's wrong there.
I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
SELECT column_name
FROM all_tab_columns
WHERE table_name = 'my_tab'; //but no rows selected?
This topic might not be what this thread should be about. Here I posted a new thread:
How to get colum names of the newly created table?
Thanks.
Message was edited by:
user569548 -
How to calculate query value on extended range of data
Hi,
This is my first post, so let me greet all forum users. I'm reading the forum for few weeks and I'm really impressed with the force of this community.
My question is based on some real problems but I'll ask in general:
In a BEx query - is it possible (and how?) in a result cell to obtain value that is calculated based on some more extended range of infoprovider records than it results from all the characteristics related to that cell?
The question is somehow about a reverse case to the restriction in Selection. I'm asking about a kind of 'extension' of selection.
Example for the question follows (it is somehow simple, I put it here just to picture the problem, note: the question is more general!)
cube: ch: 0CALMONTH, 0MATERIAL, 0PLANT
kf: 0QUANTITY (ex. of outgoing deliveries)
What I need is to obtain in any query the SUM(0QUANTITY) over all 0PLANT (this can lead to knowing the 'activity' of the specific plant by calculating the share. that activity can be calculated at diferent level of detail).
The 'dream' query would look like:
rows: 0CALMONTH, 0MATERIAL, 0PLANT
cols: 0QUANTITY SUM_OVER_0PLANT
resulting in ex:
0CALMONTH 0MATERIAL 0PLANT 0QUANTITY SUM_OVER_0PLANT PLANT_ACTIVITY
2005.01 00001 P100 10 30 1/3
2005.01 00001 P200 20 30 2/3
2005.01 00002 P100 30 70 3/7
2005.01 00002 P200 40 70 4/7
2005.02 00001 P100 50 110 5/11
2005.02 00001 P200 60 110 6/11
2005.02 00002 P100 70 150 7/15
2005.02 00002 P200 80 150 8/15
after removing drill 0MATERIAL:
0CALMONTH 0PLANT 0QUANTITY SUM_OVER_0PLANT PLANT_ACTIVITY
2005.01 P100 40 100 4/10
2005.01 P200 60 100 6/10
2005.02 P100 120 260 12/26
2005.02 P200 140 260 14/26
after removing drill 0CALMONTH:
0PLANT 0QUANTITY SUM_OVER_0PLANT PLANT_ACTIVITY
P100 160 360 16/36
P200 200 360 20/36
For this specific case I investigated several solutions:
1) using formula & function SUMCT (Result). This has a drawback that Result for 0PLANT must be present in right place (bottom level) in the resulting query. I don't like this.
2) SUM can be directly precalculated in the cube. Well, I'd prefer Bex only...
Please keep in mind also following:
1) there may be a need to refer to the data that is outside prompt/filtering/restricting range.
2) I want to preserve all the OLAP freedom, so all the solution should be a query with some tricky formula/kf/??? to be used by user in any situation and producing right result.
I hope I'm not demanding to much...
(now after this long example please have a look at the question again!)
Regards,
MirekHi Ashwin,
while using SUMCT I loose the freedom of OLAP. SUMCT calculates properly SUM_OVER_0PLANT only when the 0PLANT is the lowest drillin level. If this is not the case (ie. some other ch is the lowest level or 0PLANT results are suppressed) the approach won't provide right result.
sure I will reward all helpfull posts.
regards,
Mirek -
How to capture the values that are being passed to a function module?
Hello Experts!
While executing the transaction SBWP to send a document the FM 'SO_DYNP_SHORT_MESSAGE' gets triggered as soon as the SEND button is pressed would anybody please let me know how i can capture the values that are being passed to it in the process of sending a document?
Regards
SanguineHi
well, I'm not asking you to explain about how an implicit enhancement can be done. i was just referring to the two options posted in the reply. Is there any other way out apart from the implicit enhancement option. i do find class CL_BS useful as the Method ADD_RECIPIENT gets triggered . even though there's no attachment option in the screen that pops up after the method ADD_RECIPIENT is triggered. would anybody suggest me as how to proceed further to capture the values though without attachment details
Regards
sanguine -
How to zero the values that are greater than 0 at time 0?
Hello, New user,
I would like to know how to zero values that are greater than 0 at time 0. I am totalizing gas flow and understand how not to add the negative numbers but am unsure about the positive numbers at 0 flow. I hope I have explained this good enough.
Thank you,
LisaI don't understand why the value which should be 0 is actually greater than 0.
How do you determine that the value should be 0, such as no flow, even if the value is greater than 0?
Ryan Shi
Hello Ryan,
The system itself may have an offset of 0.1 V which in the program is related to flow. I do not wish to add this .1 as flow. I want to beable to reset the values to 0 and then when there is flow, to add the flow. If you purchase a program from some vendors you can zero the channel, that is my goal. I want this to be automatic when a switch is pressed. Such as: for 20 seconds, average channel, and use that value as 0 flow then add flow?? I was told averaging may work??
Thank you again,
Lisa Williamson -
How to find the value that is in structure???
hi experts,
i am changing standard form QM_INSP_RESULT I have an field MITTELWERT in QGRES
ie QGRES-MITTELWERT where QGRES is a structure .i need the value that is present in the field.How to find it.Hi Manikandan Muruganandham ,
To find fields the refined search is through Transaction SE84.
Go there and find the fields of your choice.
1> <b>ABAP DICTIONARY</b>
2> <b>FIELDS</b>
3> Select <b>Table fields</b> to know where you can find the field of your choice.
Reward Points if useful.
Thanks,
Tej.. -
How do I tally values that only have a ticked Check Box next to them?
Hi Folks,
I'm new to Acrobat forms and have recently finished a complicated 7 page form for a client and I am quite pleased with it.
But the client has come back with the following request:
They want Check Boxes next to a series of values and, when a Check Box is ticked, it only adds that ticked value. To show what I mean, please see the below image.
So basically, there is a field on the left-hand side (Current Monthly Repayments) that tallies all the values - in my example this totals $50.00. Then, there is a field on the right-hand side (Future Monthly Repayments) that needs to tally only the values that have a ticked "Yes" Check Box next to them. In my example, this would produce a tally of $20.00.
Does anyone know how this could be done?
Thank youYes, that's perfect. Try the following custom calculation script:
// Custom calculation script for future monthly repayments field
(function () {
// Initialize variables
var i, cb, v, sum = 0;
// Loop through each row and add repayment value if Yes is checked
for (i = 1; i < 7; i += 1) {
// Get the value of the check box
cb = getField("CashFlowCheck" + i).valueAsString;
// Get the value of the repayment field, as a number
v = +getField("CashFlow" + i).value;
// Add the value to the sum if the check box is checked
if (cb === "Yes") {
sum += v;
// Set this field's value to the sum, rounded to the nearest cent
event.value = util.printf("%.2f", sum); -
How to pass the value that the user clicks on
I have a bunch of files that i am displaying. If the user clicks on a file I am taking to another page. I want to capture
the value that the user clicks on as that's the file name.
I am displaying the list of files in a loop and have a href to the next page.
the setAttributes and getAttributes do not work as they capture only the last value in the loop.
Any suggestions what I should use?The standard approach is to send a request parameter with the click.
You are showing the filenames as hyperlinks?
Then you just have to make the link
<a href="fileDetails.jsp?fileId=<%= currentFile.getFileId() %>">currentFile.getFileName()</a>You can then use request.getParameter("fileId") to find which link was clicked.
Cheers,
evnafets -
How to calculate usage value through measuring document.
Hi,
While creating Sales Order with reference to a Contract i need to update the usgae value in the Order Quantity ( RV45A-KWMENG ) field (at line item level).
Can you help me calculate usage value through measuring documents for equipment over a period of time.
Is there any function module for the same?
Thanks.Hi,
To determine the usage value of a an equipment I had followed the following.
From table STPO, check if the material receipted belongs to a standard BOM (STLTY='S')
If yes, record the BOM (STLNR) and the BOM item node number (STLKN)
From PLMZ table, select the task list type (PLNTY), the key for task list group (PLNNR), the group counter (PLNAL), the task list node number for operation (PLNKN), if the record is not flagged for deletion (LOEZ)
From PLFH table, select the object type of the CIM resource (OBJTY), the object id of the resource (OBJID), the usage value (EWVGW) if the record is not flagged for deletion (LOEZ)
From CRVE_A table, select the equipment number (EQUNR)
The result of this selection will be all the tools which can be used for the production of the material receipted.
The measuring point for this or these equipment(s) will be selected from equipment number and EQUI table
The result of this selection will be all the measuring point to update.
Create new measurement document for the selected measurement point (transaction IK11)
Technically go as follows:-
MAT = material receipted
Select STLY, STLNR, STLKN from STPO table where IDNRK='MAT' and STLTY='S'
If results exist
Select STLTY, PLNNR, PLNAL, PLNKN from PLMZ where PLMZ.STLTY=STPO.STLTY and PLMZ.STLNR=STPO.STLNR and PLMZ.STLKN=STPO.STLKN
And PLMZ.LOEZ<>'X'
Select EWVGW, OBJTY, OBJID from PLFH twhere PLFH.STLTY=PLMZ.STLTY and PLFH.PLNNR=PLMZ.PLNNR and PLFH.PLNAL=PLMZ.PLNAL and PLFH.PLNKN=PLFH.PLNKN and PLFH.LOEKZ<>'X'
USAGE=PLFH.EWVGW
Select EQUNR from CRVE_A where CRVE_A.OBJTY=PLFH.OBJTY and CRVE_A.OJBID=PLFH.OBJID
All the equipment number selected at this moment will be called EQUIP in the next steps
EQUIP= Equipment number previously selected
Select OBJNR from EQUI where EQUNR=EQUIP
Select PARNR from IHPA where OBJNR=EQUI.OBJNR
If PARNR = Vend then
Select IMRC_POINT from equi where equnr=equip
All the measuring points selected at this moment will be called MEASP in the next steps
For each MEASP
Insert into IMRG the new increment value (USAGExMAT) in field CDIFF
Remark: the field CDIFF is managed in floating point number, accurate to 8 bytes.
I hope this is useful for you.
Regards,
Ankur Parab -
How To sort the values of a OVS result table?
Hello,
I'm trying (because i'm new je je), to implement an OVS for an inputfield in my WD app. Now i know for sure that my sophisticated value help do the search of the object and stuff, but i'm wondering if i can "sort" or include the sort method in my result table that is show in my OVS rendered view? Plis if you guys could give me some tutorials or info that would be great
Kisses
MCok that's another idea that i had in mind, built a new window, but my issue was how call that window fron the table cell, just like an OVS? wich UI Element help me with that, no link to action, no button, it most be something like an inputfield, how did you do that?
Kisses
MC -
How to create a dimension that will reference another dimension
Im creating a new cube without having a schema or DSV in place yet. Starting from scratch. In my OLTP database I have a table 'Orders' which contains various FK references to other tables, which in turn might reference two other tables.
For example. Orders has a FK to a table called MarketAuthority. This is a table that contains references to two other tables Market and Authority.
How can setup my dimension(s) to capture this, if Im starting with no DSV or schema for a data warehouse.
Correct me if Im wrong, but I think I just setup a new dimension called MarketAuthority and use it from the Measuregroup for the Orders. However, how will I reference the Authority. I assume it will be a dimension as well, but how do I relate
MarketAuthority and Authority?
In other words, say you had these types of tables in your OLTP system
Orders (salesperson, account, department ...)
OrderDetails (references order, many to 1)
Goals (references many of the same attributes eg. salesperson as order)
Im thinking I need 3 separate measure groups?
Im looking over the Adventureworks 2008 SSAS example project for how its setup.I think im looking at this all wrong.
Again, with the example tables above, I can still create 3 different measure groups, but they all will need to reference some of the same dimensions. This will result in 3 different fact tables when the schema is realized I believe?
What I think i was missing was that something like an OrderDetail table, that refers back to an Order will need references also to the same attributes as the order, at least as regard to the fact table(s).
In other words, if Orders has a SalesPerson key, account key etc, then OrderDetails will as well, IN ADDITION TO the order id as a measure.
Or ... does this sound like the case for a Fact type dimension?
https://msdn.microsoft.com/en-us/library/ms167409(v=sql.105).aspx
Hi Shiftbit,
As you said, it related to Degenerate dimensions which also called fact dimensions, are standard dimensions that are constructed from attribute columns in fact tables instead of from attribute columns in dimension tables.
http://www.jamesserra.com/archive/2011/11/degenerate-dimensions/
Regards,
Charlie Liao
TechNet Community Support -
Can we define a view that refers to 50 tables?
Hi,
I've a problem at hand and I'm not sure what the right solution I can adopt.
There is an application which hits the DB (v11.2) for accessing a single view 'XVIEW'. This view has a simple sql & join which is based on two tables XTABLE1 and XTABLE2.
Now, the new version of the schema that has got released has split XTABLE2 into 50 different tables each having a same structure. To the fix the issue, there are two solutions I could think of:
1. Create 50 views on top of 50 tables, and fix the Application to refer to these 50 new views; note: the application has hundreds of references and this has a significant work involved.
2. Rewrite XVIEW to refer to 50 tables. This will avoid changing the application, however I'm not sure if this is feasible and will have a decent performance.
I would like to go for solution 2 as it involves significantly less effort, but not sure how best i should define the view, single the 50 table structure is the same can I just union all of them?
Thanks for the help.Hi,
Hozy wrote:
Frank, thanks for helping me out.
What you are suggesting is that I should recreate the view XVIEW which does union all (as the rows will be unique) of the 50 tables, however performance will be an issue unless I can create a materialized views.
What I know of materialized views is that it's used for static, pre-computed type of data. A materialized view is pre-computed; that's what makes it faster. The time and effort spent in doing the UNION is shifted from the time when you do the queries to the time when you refresh the materialized view. Whether that is more or less total time depends on how often you query the view, and how often you refresh it. At any rate, the performance when you do the queries will be as good as possible.
Materialized views ar often used in data wharehouses, where then data may only change once a month, but they are also often used in situations like yours, where the data changes every day, or even more frequently.
In my case, the data in few of the 50 tables might change once every 24hrs and it all comes at one time. The queries that hit XVIEW should get the latest data. Is there a way I can define a materialized view which will pick up the new data in the base 50 tables?I see; you have some job that runs at, say, 2:00 am every morning, and changes some, or maybe all, of the 50 tables. You might refresh the materialized view at, say, 4:00 am every day, or at some time when you're sure that the changes to the base tables are complete. Any query that uses the materialized view between 2:00 and 4:00 am will get stale data.
You could, alternatively, make the materilaized view refresh whenever any of the base tables change, but this uses more resources, including your time and effort setting it up. -
I want to execute a stored procedure using ssis.But the problem I am having is that there is a table with 200 rows with only
single column.Now i want to execute stored procedure using value one by one from table .once the stored procedure is executed with top value from table i also want to delete that topmost column value and execute with next table value.and store the result in
text file.
please help me..or provide a package.If you want to do it in SSIS, a way to do this is by using For Each Loop as mentioned above.
Create 1 OBJECT type variable (list of values) and one STRING type variable (one value at a time)
Use EXE SQL Task with ResultSet = FULL RESULT SET and query = SELECT COL FROM TABLE ORDER BY COL ASC...output this to the OBJECT type variable
Next, a For Each loop container with Foreach ADO Enumerator, ADO object source variable = Object type variable and map that to String type variable with index = 0.
Within your for each loop container, select another EXEC SQL Task and pass in an input parameter (the String type variable) and query = EXEC PROC ? -- WHERE ? = String type variable.
This will execute your store procedure just for that one value out of the whole list.
Now within the same For Each loop, select another EXEC SQL Task and again pass in an input parameter (the same String type variable) and query = DELETE FROM TABLE WHERE COL = ? -- WHERE ? = the current value
The above process should A) get the list of values from the table B) pick one value at a time and execute the proc and delete and right after delete that value from the table.
Hope this helps.
-- some further investigation/tweaking may require but it should help you get started.
Maybe you are looking for
-
WI-FI Problem in Ipod Touch 1G
Hi people, I would like to speak my problem with my ipod touch 1g and that in fact I used wifi for years usually only a few years ago I used so usually a few months ago that stopped working this way: my wifi usually appeared so I clicked on the netwo
-
Visual Studio 2008 Dataset Designer
Hello, I've noticing an annoying issue using VS2008 Final with ODT 11 beta2. When I change any object from DataSet designer the VS2008 freezes for awhile. In the same time one Oracle (10g R2) process hits 100% CPU usage. What does the designer do to
-
New iPad still restoring(setting up) 24 hr. later...
I just bought a new iPad Mini 3 which I set up yesterday to restore from an iCloud backup of my old iPad. 24 hours later, it is evidently still restoring. All the apps are on and loaded; nothing seems amiss. Could it be photos that are taking so long
-
For a USB hotspot connection I am requested to "Choose iPhone from the list of network services". Where do I find this list?
-
BOOTCAMP PROBLEM - Pc partition won't delete
I am trying to rerun bootcamp but it tells me that I have to format to only one single mac os x drive but the problem is that I cannot delete the PC partition. I probably should have reformatted to one drive using bootcamp before I reinstalled mac os