Calculations at Query
Hi,
We are facing the following problem getting out the correct values for formulae at query time.
I am giving the example records for an easy understanding.
Sales Doc Item qty value
1 10 1 2
1 20 3 6
I have to calculate the net price which is a formula derived by multiplying the qty and value fields.
Suppose my query does not iunclude the Item field in the rows, the output will be
32 which will give me the wrong value. I cannot include the sales doc number in the report. Even I cant include it and hide it because it will spoil my report layout.
This must be a problem which everyone might have faced. Please share your views on this.
Thanks.
Vinci.
Message was edited by:
Vinay Dutt
Vinay,
You will have to use exception aggregation to handle this. In older version, you could have used before aggregation feature to resolve it, in the newer version before aggregation has been removed.
-Saket
Similar Messages
-
HI Experts,
I need some calculations at query level,
find the below user requirement.
And one more thing we are not authorised to use Customer exits.
SELECT
[FA No] As [FA No],
[FA Description] As [FA Description],
Sum( CASE WHEN [Posting Date] < @fromDate THEN Amount ELSE 0 END) AS [Starting Balance],
Sum( CASE WHEN [Posting Date] >= @fromDate AND [Posting Date] <= @toDate THEN [Debet Amount] ELSE 0 END) AS [Debet Amount],
Sum( CASE WHEN [Posting Date] >= @fromDate AND [Posting Date] <= @toDate THEN [Credit Amount] ELSE 0 END) AS [Credit Amount],
Sum( CASE WHEN [Posting Date] <= @toDate THEN Amount ELSE 0 END) AS [Ending Balance],
Sum( CASE WHEN [Posting Date] >= @fromDate AND [Posting Date] <= @toDate THEN [Amount] ELSE 0 END) AS [Net Change]
FROM FA06data
GROUP BY [FA No], [FA Description]
Please help as early as you can.
Thanks,
NaveenThanks for your responce.
we are using Sql with the query designer.
what we can use? like calculated key figure. -
Key Figure Calculation in Query
Gurus,
How do i calcculate below in query basically i have 3 KF as dates below and want a CKF or formula variable
which calculates A - (IF B Not Empty then take B or else take C.)
Z = A - if (B != " '', B, C)
A = Key Figure
B = Key Figure
C = Key Figure
thanksHI Zuben,
To acheive this
calculates A - (IF B Not Empty then take B or else take C.)
Z = A - if (B != " '', B, C)
A = Key Figure
B = Key Figure
C = Key Figure
Try this !!!!!!!
If u create a CKF,u will have operators in it,in that choose Boolean Operators,again in that chose
1)is not equal to
and
2)Equal to.
for ur calculations.
Z= Calculated Key Figure.
Z= A - (B NE 0)B + ( B EQ 0)C
Case One -- B NE 0
Z= A-(1 * B)+0
Z = A-B
Case Two -- B EQ 0
Z= A-(0 * B)+(1*C)
Z = A-C
I guess this is your requirement.
Rgds
SVU -
Percentage Calculation in Query
Hi Gurus,
Hope you are all doing good! I have an issue in my query. I have calculated the summation of Profit for 05 and 06 . In the properties these are the specification i have given :
1.Scaling Factor : 1,000,000
2.Number of Decimal Place : 0.0
3.Calculate Result As : Summation
I get the summation for both 05 and 06 correctly. I computed the percentage for
both and seems to be fine.
Formula used for computing percentage : ' / Profit 06' / ' / Profit 05' * 100
My issue being the Over all percentage seems to be high.
Any idea Gurus?
Points would be surely assigned.
Regards,
Sunitha.RHi Norris Silva,
As per your scenario total questions = 11
persons (c1, c2, c3, c4, c5) = 5
c1 answered questions = 5
c2 " " = 5
c3 " " = 1
here to calculate the percentage of answered questions
for each person. This can be calculated as below with use of
calculated key figure
c1's % ---> ci1 answered questions/total questions * 100
5/(551)*100= 45.45%
like write formula in calculated key figure for each person.
Hope it helps you...
Regards,
Ramki. -
Unit of Measure Calculation in Query
Hi,
I have a few calculated keyfigures in my query for example:
whats happening:
KEY 1= Standard Price * Qty A = Output in (LBS) Qty unit of measure
What I want is:
KEY 1= Standard Price * Qty A = Output in $
How can i fix that on the query level so that my output is in $
Thanks
Edited by: DANIEL GREEN on Jun 12, 2008 2:33 AMHi
change the target currency and conversion type.
--- Pravin -
Calculations in query taking long time and to load target table
Hi,
I am pulling approx 45 Million records using the below query in a ssis package which pulls from one DB on one server and loading the results to another target table on the another server. In the select query I have a calculation for 6 columns. The target
table is trunctaed and loaded every day. Also most of the columns in the source which I used for the calculations is having 0 and it took approximately 1 hour 45 min to load the target table. Is there any way to reduce the load time? Also can I do the calcultions
after once all the 47 M records loaded during query running and then calculate for the non zero records alone?
SELECT T1.Col1,
T1.Col2,
T1.Col3,
T2.Col1,
T2.Col2,
T3.Col1,
convert( numeric(8,5), (convert( numeric,T3.COl2) / 1000000)) AS Colu2,
convert( numeric(8,5), (convert( numeric,T3.COl3) / 1000000)) AS Colu3,
convert( numeric(8,5), (convert( numeric,T3.COl4) / 1000000)) AS Colu4,
convert( numeric(8,5),(convert( numeric, T3.COl5) / 1000000)) AS Colu5,
convert( numeric(8,5), (convert( numeric,T3.COl6) / 1000000)) AS Colu6,
convert( numeric(8,5), (convert( numeric,T3.COl7) / 1000000)) AS Colu7,
FROM Tab1 T1
JOIN Tab2 T2
ON (T1.Col1 = T2.Col1)
JOIN Tab3 T3
ON (Tab3.Col9 =Tab3.Col9)
AnandSo 45 or 47? Nevertheless ...
This is hardly a heavy calculation, the savings will be dismal. Also anything numeric is very easy on CPU in general.
But
convert( numeric(8,5), (convert( numeric,T3.COl7) / 1000000))
is not optimal.
CONVERT( NUMERIC(8,5),300 / 1000000.00000 )
Is
Now it boils to how to make load faster: do it in parallel. Find how many sockets the machine have and split the table into as many chunks. Also profile to find out where it spends most of the time. I saw sometimes the network is not letting me thru so you
may want to play with buffers, and packet sizes, for example if OLEDB used increase the packet size two times see if works faster, then x2 more and so forth.
To help you further you need to tell more e.g. what is this source, destination, how you configured the load.
Please understand that there is no Silver Bullet anywhere, or a blanket solution, and you need to tell me your desired load time. E.g. if you tell me it needs to load in 5 min I will give your ask a pass.
Arthur
MyBlog
Twitter -
Gross Price Calculation sql query
Hi Guys,
I have created a udf (quantity s) in purchase order service type. now i want the gross price to be calculated based on the quantity. can anyone help me on the query for the formatted search.
Please help.
cheers
satishHi,
Try this......
SELECT (($[POR1.Price.NUMBER] ) * ($[POR1.u_sqty.NUMBER])) -
Complex SQL calculated/Group Query
I am trying to write a complex aggregate query(s) to compile a standings table for a soccer league.
There are four related tables:
Matches
Goals
Players
teams
I have yet to finalize the database structure so I can add fields if necessary.
In the goals table I track the match that the goal was scored in and which player
scored it.
I am trying to create a query that will give me a standings table.
The fields I need to calculate are:
team name
Wins
Loses
Draws
For instance: There was a match on 4/21/2012. The players on HomeTeam(A) scored a combined 6 goals. The players on AwayTeam(B) scored 1 goal (All stored in the Goals table). Therefore, Hometeam won by a score of 6-1. I need
a query that spits out:
Team Wins Losses Draws
Points
HomeTeam(A) 1 0 0
3
AwayTeam(B) 0 1 0 3
Wins are worth 3 Losses 0 and Draws 1 point each team.
I am a long time SQL admin, but I think the complexity of calculating this is a little beyong me. I need some help to get where I need to be.Okay, I haven't yet been able to figure out the draws because of the trouble of linking back to both teams, but here's what I have so far.
First, here is the test data:
Declare @tvMatches Table (
MatchID int IDENTITY(1,1)
,MatchDate datetime
,HomeTeamID int
,AwayTeamID int
Declare @tvGoals Table (
GoalID int IDENTITY(1,1)
,MatchID int
,PlayerID int
,TeamID int
Declare @tvPlayers Table (
PlayerID int IDENTITY(1,1)
,TeamID int
,PlayerName varchar(30)
Declare @tvTeams Table (
TeamID int IDENTITY(1,1)
,TeamName varchar(20)
Insert @tvTeams
Select 'Winners'
Union All
Select 'Losers'
Union All
Select 'Friars'
Union All
Select 'Planes'
Insert @tvPlayers
Select 1, 'Bill'
Union All
Select 1, 'Jim'
Union All
Select 1, 'Ken'
Union All
Select 2, 'James'
Union All
Select 2, 'Smithy'
Union All
Select 2, 'Flip'
Union All
Select 3, 'Dave'
Union All
Select 3, 'Alan'
Union All
Select 3, 'Ethan'
Union All
Select 4, 'Naomi'
Union All
Select 4, 'Erland'
Union All
Select 4, 'Alejandro'
Insert @tvMatches
Select '20120101', 1, 2
Union All
Select '20120201', 3, 4
Union All
Select '20120301', 4, 1
--Winners beat Losers 3-2
--Planes beat Friars 4-2
--Winners beat Planes 2-1
Insert @tvGoals --Match, Player, Team
Select 1, 1, 1
Union All
Select 1, 3, 1
Union All
Select 1, 5, 2
Union All
Select 1, 6, 2
Union All
Select 1, 2, 1
Union All
Select 2, 7, 3
Union All
Select 2, 8, 3
Union All
Select 2, 10, 4
Union All
Select 2, 11, 4
Union All
Select 2, 12, 4
Union All
Select 2, 11, 4
Union All
Select 3, 1, 1
Union All
Select 3, 3, 1
Union All
Select 3, 11, 4
Using this test data, you want to compile the actual match outcomes. This can be problematic to do on the fly every time though, if you have a lot of matches or teams to calculate for. But, with a simple cte, we have:
;with cteMatches as
Select m.MatchID
,m.MatchDate
,m.HomeTeamID
,ht.TeamName HomeTeamName
,m.AwayTeamID
,at.TeamName AwayTeamName
,( Select Count(1)
From @tvGoals g
Where g.MatchID = m.MatchID
And g.TeamID = m.HomeTeamID
) HomeScore
,( Select Count(1)
From @tvGoals g
Where g.MatchID = m.MatchID
And g.TeamID = m.AwayTeamID
) AwayScore
From @tvMatches m
join @tvTeams ht
on m.HomeTeamID = ht.TeamID
join @tvTeams at
on m.AwayTeamID = at.TeamID
) --select * from cteMatches
This returns the MatchID, MatchDate, team information and the score. Basically, you have the match, team and player data tied to the goals table, so you just do a count (using correlated subqueries) to get the score of each team. Next step is
to calculate the winner and loser (and eventually whether there even was a winner) by comparing the scores:
,cteWinners as
Select cm.MatchID
,cm.HomeTeamID
,cm.HomeTeamName
,cm.AwayTeamID
,cm.AwayTeamName
,Case
When cm.HomeScore > cm.AwayScore Then cm.HomeTeamID
When cm.HomeScore < cm.AwayScore Then cm.AwayTeamID
Else 0
End WinningTeamID
,Case
When cm.HomeScore > cm.AwayScore Then cm.AwayTeamID
When cm.HomeScore < cm.AwayScore Then cm.HomeTeamID
Else 0
End LosingTeamID
From cteMatches cm
) --select * from ctewinners
This returns MatchID, team information and the ID's for winning and losing teams. For now it returns 0 if it's a draw. Once we know the outcomes of all the matches, we calculate the actual win/loss for each team:
,cteRecords as
Select t.TeamName
,Count( Case
When cw.WinningTeamID = t.TeamID Then 1
End
) Wins
,Count( Case
When cw.LosingTeamID = t.TeamID Then 1
End
) Losses
From @tvTeams t
join cteWinners cw
on t.TeamID = cw.HomeTeamID
or t.TeamID = cw.AwayTeamID
Group By t.TeamName
) --select * from cteRecords
That last cte returns just team name, and then the number of wins and losses for each team. This is where I got stuck with the draws, because I'm not quite sure yet how to properly assign a draw to both teams involved.
Now, finally you put it all together with some simple match to determine the points, and there you are:
Select TeamName
,Wins
,Losses
,(Wins * 3) Points
From cteRecords -
Percentage calculation on query designer (7.0)
Hi experts,
I´m new on Query designer (7.0) and I´m trying to do a finnancial report, so for the lines I create and structure using G/L accounts and in the columns I got the amount for each level in my structure for a month. Now I´m trying to create an Integration percentage, it specifies how high the percentage in a level is in relation to next higher level but so far I couldn't make it...
My report must seem like this:
Structure.............................Amount ...... Int %
1. Assets................................1000 ....... 100%
1.1 Current assets.................... 600 ....... 60% -> (600/1000)*100
- Cash............................. 300 ........ 50% -> (300/600)*100
- Inventories..................... 300 ........ 50% -> (300/600)*100
1.2 Long-term assets................ 400 ....... 40% -> (400/1000)*100
- Property, plant and eq..... 150 ....... 37.5% -> (150/400)*100
- Investment property......... 150 ....... 37.5% -> (150/400)*100
- Intangible assets..............100 ....... 25% -> (100/400)*100
I try to use each Percentage calculation options (%, %A, %CT,%GT, %RT) but it didn't work. Can anyone help me in creating a formula to get this percentage?
ThanksHi,
check this notes and links to get an overview how to use:
III. List Calculations (e.g.'Calculate result as..'):Interesting facts about the OLAP Processor/Analytic Engine
SAP Note Number: [1151957|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d31313531393537%7d]
If, in a structure element (key figure ID), you use the 'Calculate Results as' and 'Calculate Single Value as' properties with their additional fields at the same time, priority problems occur and the system behavior is not immediately clear.:
Calculate Results/Single Values as ... priority rules
SAP Note Number: [853058 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bw_bex/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d383533303538%7d]
Regards
Andreas -
Bex Query - Specific calculation in query result
Hi experts!
I've received a requirement and I cannot find any way to delivery it using the stantard operation or configuration into Bex Query.
We have a query which have three KF with summarization in result. The new requirement is based in the KF "POND" to change the calculation in the result. Below are the actual result and the expected result.
The actual query result.
Line
OP
QTD
TMP
POND
A1
1614073
702
19
13338
Total A
702
19
13338
B1
1587949
840
235
197400
B2
1610938
4.240
28
118720
Total B
5.080
263
316120
Total A + B
5.782
282
329458
The expect result based on the new requerment
Linha
Ordem de Produção
QTD
TMP
POND
A1
1614073
702
19
13338
Total A
702
19
19
B1
1587949
840
235
197400
B2
1610938
4.240
28
118720
Total B
5.080
263
62
TOTAL A + B
5.782
282
57
Check out the "Total A" result for KF "POND", the new calculation is the sum of KF "POND" divided by the sum of KF "QTD" (13338 / 702 = 19)
The same to "Total B" result for KF "POND", the calculation is the sum of "POND" divided by sum of KF "QTD" ( (197400 + 118720) / (840 + 4240) = 62).
I've been using all recourses into Bex query, but I've haven't found any way to deliver this requirement, though.
I'd really appreciate if anyone could give me some suggestion to deliver this requirement.
Thank you.
César Sevilha.Hi Suman!
Thanks for your replay.
The collision options wont help me because I have calculation on the same structure.
I need to keep the division POND by QTD in the result. Check out the table below.
The Formula Bex Query (POND / QTD) is a simple division between KF POND by KF QTD, the result
is a totalization of lines A and B.
The requirement is to keep this division on the result. Check out the column Requirement, this is the result expected.
Line
OP
QTD
POND
Formula
Bex Query (POND / QTD)
Requirement
A1
1614073
702 KG
13.338 KG
19 KG
19 KG
Total A
Result
702 KG
13.338 KG
19 KG
19 KG
result (POND) divided by result (QTD)
B1
1587949
848 KG
197.400 KG
233 KG
233 KG
B2
1610938
4.318 KG
118.720 KG
27 KG
27 KG
Total B
Result
5.167 KG
316.120 KG
260 KG
61 KG
result (POND) divided by result (QTD)
Total A + B
Result
5.869 KG
329.458 KG
279 KG
56 KG
result (POND) divided by result (QTD)
I'd like to know how to keep the division in the result.
Example:
The result of Total B should be 61 kg which is the result of division between the result of KF POND (316.120) by the result of QTD (5167).The currently formula has as result the totalization of B1 and B2.
Thank you in advance.
César Sevilha. -
Need Some Calculation in Query
i have following sample data
select * from temp ;
CODE DDATE STAT CO_CODE COM FND_CODE FUND AMOUNT UNITS UBAL
76 24/06/2010 I 1 A B C 28 X Y Z 59854592 5787134.11 5787134.11
76 29/06/2010 R 1 A B C 28 X Y Z -1690984.6 4096149.47
07/07/2010 I 1 A B C 28 X Y Z 143454.173 4239603.65
76 19/07/2010 R 1 A B C 28 X Y Z -1393464.6 2846139.00
I need a query that will display all feilds with this calculation
continuee after UBAL
59854592(amount) / (Units) 5787134.11 = Avg (10.3427)
CODE DDATE STAT CO_CODE COM FND_CODE FUND AMOUNT UNITS UBAL Avg ABal
76 24/06/2010 I 1 A B C 28 X Y Z 59854592 5787134.11 5787134.11 10.3427 59854592
2nd line
If STAT = R then
-> Units * Above AVG = amount
-> Above ABal (59854592) - Current Line Amount (17489346) = ABal 42365246
-> Abal / Ubal = Avg
76 29/06/2010 R 1 A B C 28 X Y Z 17489346 -1690984.6 4096149.47 10.3427 42365246
(1690984.6*10.3427)
3rd Line
If STAT = I
-> Abal same as Above 42365246
-> Abal / Ubal = Avg
07/07/2010 I 1 A B C 28 X Y Z 143454.173 4239603.65 9.9927 42365246
4th line (same as 2nd line)
If STAT = R then
-> Units * Above AVG = amount
-> Above bal - Current Line Amount = ABal
-> Abal / Ubal = Avg
76 19/07/2010 R 1 A B C 28 X Y Z 13924473 -1393464.6 2846139.00 9.9927 28440773
Need your HelpAhmed,
You may have to tweak the rounding a little, but this'll get you started:
SQL> create table mytable (code,ddate,stat,co_code,com,fnd_code,fund,amount,units,ubal)
2 as
3 select 76, date '2010-06-24', 'I', 1, 'A B C', 28, 'X Y Z', 59854592, 5787134.11, 5787134.11 from dual union all
4 select 76, date '2010-06-29', 'R', 1, 'A B C', 28, 'X Y Z', null, -1690984.6, 4096149.47 from dual union all
5 select null, date '2010-07-07', 'I', 1, 'A B C', 28, 'X Y Z', null, 143454.173, 4239603.65 from dual union all
6 select 76, date '2010-07-19', 'R', 1, 'A B C', 28, 'X Y Z', null, -1393464.6, 2846139.00 from dual
7 /
Table created.
SQL> select code
2 , ddate
3 , stat
4 , co_code
5 , com
6 , fnd_code
7 , fund
8 , amount
9 , units
10 , ubal
11 , myavg "Avg"
12 , abal "ABal"
13 from mytable
14 model
15 partition by (co_code,com,fnd_code,fund)
16 dimension by (row_number() over (partition by co_code,com,fnd_code,fund order by ddate)-1 rn)
17 measures (code,ddate,stat,amount,units,ubal,0 myavg,0 abal)
18 rules iterate (100) until (ddate[iteration_number+1] is null)
19 ( amount[iteration_number] = case stat[iteration_number]
20 when 'R' then round(abs(units[iteration_number]) * myavg[iteration_number-1])
21 else amount[iteration_number]
22 end
23 , abal[iteration_number] = case stat[iteration_number]
24 when 'I' then nvl(abal[iteration_number-1],amount[iteration_number])
25 when 'R' then abal[iteration_number-1] - amount[iteration_number]
26 end
27 , myavg[iteration_number] = round(abal[iteration_number] / ubal[iteration_number],4)
28 )
29 order by co_code
30 , com
31 , fnd_code
32 , fund
33 , ddate
34 /
CODE DDATE S CO_CODE COM FND_CODE FUND AMOUNT UNITS UBAL Avg ABal
76 24-06-2010 00:00:00 I 1 A B C 28 X Y Z 59854592 5787134.11 5787134.11 10.3427 59854592
76 29-06-2010 00:00:00 R 1 A B C 28 X Y Z 17489346 -1690984.6 4096149.47 10.3427 42365246
07-07-2010 00:00:00 I 1 A B C 28 X Y Z 143454.173 4239603.65 9.9927 42365246
76 19-07-2010 00:00:00 R 1 A B C 28 X Y Z 13924474 -1393464.6 2846139 9.9928 28440772
4 rows selected.Regards,
Rob. -
I am doing a date difference calculation on two date characteristics, i am doing this at the query level. For each date characteristics i have created a formula variable. I have then created a CKF and i have used these formula variable in that CKF to get the date difference. I am getting the date difference correctly if there are dates in both the Date 1 and Date 2 characteristics, But if either one of the date field is blank i am getting wierd value.
Date1------- Date2 -
Difference
9/20/2008---- 9/15/2008---- 5
#Blank-- 9/15/2008-- -733,301
#Blank-- 9/12/2008-- -733,298
I know this problem can be sorted by writing a ABAP routine in the update rule, but i dont want that solution as i want these CKF to be created by the users.
Points will be awarded.Hi RAO,
I used your logic and it is working for the blank values but it is giving me a wrong result for the condition in which i have both the dates.
Condition 1
9/25/2008 - 9/12/2008 = -13
It should be 13.
Condition 2
Blank - 9/12/2008 = 0
I want the result for this to be blank. -
Add calculated field (Query - SQ01)
Hi to all,
I would know how can i add a calculated field to a Query (SQ01) ?
Can you give me an example of abap code to insert in CODING section ?
thksHi,
My understanding about your question is you want to display the total for two standard fields in a table,
1) Personalize the table and make true for the property Total.
2) If you want to calculate both the column total,
Add a MessageStyledText via personalziation to the page, and extend the controller
and in the ProcessRequest
Get the handle of the AM and then ur attributes VO Attributes and traverse through the VO rows and get the total of both the columns
and set the value to the newly created MessageStyledText.
Let me you want any sample code for the second step.
Thanks.
With Regards,
Kali.
OSSi. -
Hi all,
I have a query with the following key figure:
ZCOUNT Counter of the order items
X = Y/Z global calculated key figure
A = X/ZCOUNT
I need the following result in my query:
X ZCOUNT A
50 10 5
30 5 6
result 80 15 5,33
but the real result is not as above in the example because in the result row the system don't use the formula A = X/ZCOUNT
Why?
How can I do please?
GianmarcoHi Gianmarco,
I hope that key figure A you have created is a local one.
Ususallly whatever formula we specify's in a key figure that's also applicable to result row as well untill unless we dont specify anything in 'Calculate result as ' in calculation tab of calculated key figure.
So please check this that you are not having total or any other option selected in Calculate result as option.
We need not to do anything extra for ur above requirement as the same thing is a very normal thing expected by customer's and logically correct as well. We also have done for many of our customers by creating local key figures and choosing 'Nothing defined' in calculation tab and that worked absolutely fine.
Thanks
Dipika -
Nav Attribute Calculation in Query with replacement path variable
Gurus,
Can we use attribute of a charecteristic in calculation based on the sap how to below.
https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc&overridelayout=true
Basically above document uses attribute which is KF key figure ,but i want to use a attribute which is if type - NUMC.
So the question is can i directly use the same steps mentioned in the link or need to modify because the type is NUMC.
Thanks in advanceHi Andrew,
You can not use the attribute with NUMC in calculation. In order to do the calculatio based on attribute you have to create the attribute as Key Figure type. I mean to say as described in the document.
NUMC is data type Char string with numbers and you can not do calculation based on Char string.
Regards,
Kams -
Help needed in creating a calculated keyfigure/query exit
Hi Reporting Gurus
Please someone give me a solution for my issue.
I have two keyfigures
Plan Finish Date(PFD)
Actual Finish Date(AFD)
I have one calculated keyfigure
Delivery Status = (AFD<=PFD) . When this condition is met it returns 1 else 0.
But Delivery Status = (AFD<=PFD) returns 1 if AFD and PFD both exists and if the condition is met and also works (returns 1) for the scenarios mentioned below.
1. if AFD is blank and PFD is filled
2. if AFD and PFD both is blank.
So I need a solution for my issue in such a way that
Delivery Status = (AFD<=PFD) should return 1 only if AFD and PFD both exists and only if AFD<=PFD.
For rest of all the scenarios my calculated keyfigure should return 0 , i.e.,
1.if AFD is blank and PFD is filled
2.if AFD and PFD both is blank.
3.if AFD is filled and PFD is blank.
How to achieve this?
Should I have to write a customer exit variable and incorporate ABAP codes or should I have to write VB macros or can we have a calculated keyfigure with a necessary logic or is there any other way to achieve it.
Please help me out.
Thanks in Advance,
Have a nice day
Regards
SamYou can create a new calculated key figure which calculates the result which looks as follows...
= ((AFD<>0) AND (PFD<>0) AND (AFD<=PFD)) * 1 + 0
Please check the syntax when done. You can refer to the below link for more info abt using IF ELSE operations in calculated keyfigures. Please let me know if you come across any issues.
http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm
Maybe you are looking for
-
Notifications center and Facebook.
Hi guys, I've been trying to figure out the awesome features of OS X mountain lion's notification center. Is it possible to post to a Facebook fan page from notification center? I think yes but the groups list is only limited. Can I update this list?
-
How do I transfer text messages to word document in computer
I want to transfer text messages from my Iphone 6 to my Mac Pro. How do I do this?
-
I am Beginner winrt and sql lite , I am creating app that Customer table I want how to add data to the Table, edit the data, delete selected data, and delete all Please help me Any One Here code maybe wrong please right code provide me using SQLite;
-
How to print multiple values seperated by comma in a table
Dear All, I have one requirement where am not able to acheive it in BO XI R4 . I tried as per this link http://scn.sap.com/thread/3245018 and it did not get the expected result. Assuming that i hagve the data as shown in below table Name City A YY
-
Why can't I open new tabs?
When I click on a new tab, or go to 'File', 'New Tab' nothing happens. If I click on a link a new tab will open up, but I cannot get a blank one to open so I can type in a new website.