Calculate count of zero (key figures)
Hi Friends,
The output of the query is as follows:
Row
Group
Sub group
Column
No. of incidents
Processing time
Characteristics are placed in row and keyfigures in column. There is an additional characteristice "team" which is not displayed in the report.
Now i wish to count the number of incidents for which the processing time is zero and also with the restriction of team A and team B.
I am able to count the number incidents with processing time zero. But able to restrict this to particular team.
Regards,
Surjit
What I meant to ask is, time is recorded by name level right?
If one team can have 5 different names and out of those 5 names, 3 of them have time as ZERO and 2 of them dont have time ZERO. When you set the exceptiona aggregation, you will get 3 because calcualtion is done at name level, but you can not perform the exception aggregation at team level because that will be performed on the summation of all the times from all 5 persons of that team, which will not be ZERO.
My same question was, if you have 3 teams under sub group, how do you want to see the number in the report.
Row1 Row2 Row3 Col1 Col2
Grp Sub Grp Team1 x x
____________Team2 x x
This is not possible without having team in the report. Either you sum them up, but the team level calcualtion it self is wrong, so it really doesnt matter if you add them up at sub group level or not.
- Danny
Similar Messages
-
How to calculate percentage based on key figure maximum value
Hello everybody!
I need your expertise on a query 'issue' I'm facing. Let's say I have a query getting me the Number of Open Items per Week (starting from billing document's Issue Date).
My client wants to be able to see the percentage per week and not the actual number.
So, what I have is below:
<b>Wk</b><b>"OI Nr"</b>
1 "68.801"
2 "66.288"
3 "59.344"
4 "50.506"
5 "20.950"
And what I want is below (in italics):
<b>Wk</b><b><i>"OI %"</i></b>
1 "<i>100% </i>" (i.e. 68.801 / 68.801 * 100)
2 "<i> 96,34% </i>" (i.e. 66.288 / 68.801 * 100)
3 "<i> 86,25% </i>" (i.e. 59.344 / 68.801 * 100)
4 ......
5 ......
Is it possible to achieve sth like this by altering some key figure properties or in any other way?
Thanks in advance.First u need to create a calculated Key Fig globally. You can do this at the extreme left end of the query Designer. Just right click on the Calculated key Fig and say <b>New Calculated Key Figure</b>
Give the description of the Key Fig and in the formula section just put the the key fig . <b>'OI Nr'</b> in you case
When u say ok it will open the properties of the key fig there u can see <b>Enhance>></b> at the bottom. Click on that make the <b>exception aggregation</b> to <b>maximum</b> and <b>refernce characteristic</b> for the one which u are having the values 68.801, 66.288, 59.344, ..
Save this calculated key fig
now in the Columns create a <b>new selection</b> under the key fig.
drag the newly created calculated key fig in this <b>new selection</b> and say ok.
Now right click on this <b>new selection</b>, go to the <b>Calculated Single Value</b> as drop down and make it <b>Normalize-Sub Totals</b>
Tick the checkbox <b>Also Apply to result</b>
and select <b>Calculate Along Columns</b>.
Save the query and execute. This should solve youe issue
Hope this helps. -
How to calculate the value of key figure by considering other char or kf
Hi
My requirement is like this:
I have a key figure which gives me the planned issues and receipts but i know that if only from locaton is blank and to loc is filled then that are receipts and if both the from and to location values are filled then it is issues,
can you pls let me know how i 'll put this logic in th reporting bex and how i achieve this by user exit or any other way
thx
rubaneCreate two RKF, restrict first with [ from = '#' ] to get the planned receipts, and restrict the second with [ from <> '#' and to <> '#' ] to get the issues.
-
Hi All,
I have an issue using COUNT in a query. The issue is that I have to count the no. of material based on a certain KF, say sales. If the sales amount or value is non-zero then the material has a count of 1. If the sales amount is zero then the count is 0.
Now, I need to display the no.of materials in a particular period with sales in that period. Could you please let me know how is this possible?Hi Bjorn,
When I set the Maeterial to 'No Display', I am still getting individual rows for all the material in addition to the overall result row. For example:
Count of Material 1
Sales Amount 10
Count of Material 1
Sales Amount 30
So on and so forth...
In addition I get the overall Result row,
Count of Material 2
Sales Amount 40.
Please advise as to how to display just the overall result and not the individual rows. -
Counting Key Figures above a threshold
HI Experts
I need to count a calculated key figure only when is above a threshold:
DIV | CONTRACT | Calculated CONSUMPT
01 101 40
01 102 30
01 103 50
02 201 20
02 202 40
02 203 10
The output should look somethinhg like
DIV | BandWithConsumpt | No. of Contracts
01 Greater than 30 2
02 Greater than 30 1
The number of records is huge (>65536) so conditions is not an option as far as I know.
I will appreciate your help
Thanks,
CarlosHi ,
See below help doc to count the occurence of a characteristics.
[Count the occurrences of a characteristic relative to one or more other Characteristics|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7e58e690-0201-0010-fd85-a2f29a41c7af]
and Create a condition with the required threshold.
Thanks
Sundar -
ELSEIF in calculated key figure
Dear gurus
We have recently upgraded to NW2004s, and would need some help on the formula for my calculated key figure. This calculated key figure is meant to replicate IF... ELSEIF statement, depending on what the user enters. The logic that we have are as below :
IF Var=1, then display key figure A
ELSEIF Var=2, then display key figure B
ELSEIF Var=3, then display key figure C
ELSEIF Var=4, then display key figure D
where Var is a Formula Variable, Processing By User Entry/Default value.
The formula that we have originally, in BW3.5 is :
<i>(Var == 1) * 'Amount in TC' + (Var== 2) * 'Amount in Comp Code' + (Var == 3) * 'Amount in Parall USD' + (Var == 4) * 'Amount in Hard Cur' </i>
This formula has served us well in BW 3.1 to BW 3.5, and never had any problems with it. However, when we migrated over to BW 7.0, we could not get values for this formula (eventhough we have data in our cubes). The only data that get is when we key in Var=1, but when we try with Var=2, 3 or 4, no data is displayed in our key figure.
We tried to debug, but somehow we could not figure out how the new BW7.0 calculates these type of key figures, and whether is there a change in the formula variable. We believe that the problem may lie in the way that BW 7.0 interprets the formula above, and only obtains the first portion of the formula (Var==1).
We would appreciate any helps, and of course, points will be awarded if problem can be solved.
Thanks a lotDear all
With some luck in searching, I manage to find an OSS note which depicts this error and resolve it. For those who have the same problem, please use this OSS Note 994194.
Cheers -
Key Figure calculation in Abap is not working correctly - Overlooping
Hi,
I wrote a logic to calculate the ratio of key figure but it is not working correctly
For example I have a requirement to split 1 Product into Several new Products and also the Net Amount will be splitted to these several new products as well. The total Amount of the new product will be equivalent to the Net Amount.
So far my Logic is splitting the product to several new products but the amount is incorrect as the calculation is over looping.
Sample
A PRODUCT has Net Amount 1000. And this product needs to be splitted into 3 new products. Each of this new product is assigned a ratio of 0.3, 0.2 and 0.7 respectively. total sum of the ratio is 1.
PRODUCT1 0.3 = 1000 * 0.3 = 300
PRODUCT2 0.2 = 1000 * 0.2 = 200
PRODUCT3 0.7 = 1000 * 0.7 = 700
The total amount of this new products is 1000.
Now my logic is working this way.
PRODUCT1 0.3 = 1000 * 0.3 = 300
PRODUCT2 0.2 = 1000 * 0.2 * 0.3 = 60
PRODUCT3 0.7 = 1000 * 0.2 * 0.3 * 0.7 = 42
Only the PRODUCT1 is working correctly and there is overlooping for the remaining products
Logic used
DATA: t_data TYPE data_package_structure OCCURS 0 WITH HEADER LINE.
DATA: t_newdso LIKE /bic/newdso OCCURS 0 WITH HEADER LINE.
DATA: t_olddso LIKE /bic/olddso OCCURS 0 WITH HEADER LINE.
DATA: amount LIKE data_package-netamount.
DATA: zidx LIKE sy-tabix.
REFRESH t_data.
LOOP AT data_package.
zidx = sy-tabix.
MOVE-CORRESPONDING data_package TO t_data.
REFRESH t_newdso.
SELECT * FROM newdso INTO TABLE t_newdso WHERE prod =
data_package-prod.
SORT t_newdso BY prod.
*LOOP AT T_NEWDSO.
READ TABLE t_newdso WITH KEY prodh4 = t_data-prod.
IF sy-subrc EQ 0.
LOOP AT t_newdso.
t_data-prod = t_newdso-/bic/znew_mp.
t_data-material = t_newdso-material.
*T_DATA-NETAMOUNT = T_DATA NETAMOUNT * T_NEWDSO-/BIC/ZSP_RATIO.*
APPEND t_data.
ENDLOOP.
ELSE.
REFRESH t_olddso.
SELECT * FROM olddso INTO TABLE t_olddso WHERE prod =
data_package-prod.
SORT t_olddso BY prod.
READ TABLE t_olddso WITH KEY prodh4 = t_data-prod.
t_data-prod = t_olddso-prod.
t_data-material = t_olddso-material.
APPEND t_data.
ENDIF.
MODIFY data_package INDEX zidx.
ENDLOOP.
REFRESH data_package.
data_package[] = t_data[].
thanks
Edited by: Matt on Sep 27, 2010 2:25 PM - added tagsHi,
I am not really good at debugging Abap code since I am a newbie. however I have tried to add CLEAR T_DATA before the first loop.
REFRESH T_DATA.
LOOP AT DATA_PACKAGE.
ZIDX = SY-TABIX.
MOVE-CORRESPONDING DATA_PACKAGE TO T_DATA.
and before the second loop and select statement and at the end of the loop.
REFRESH T_NEWDSO.
SELECT * FROM NEWDSO INTO table T_NEWDSO WHERE PROD =
DATA_PACKAGE-PROD.
SORT T_NEWDSO BY PROD.
READ TABLE T_NEWDSO WITH KEY PROD = T_DATA-PROD.
IF sy-subrc EQ 0.
LOOP AT T_NEWDSO.
but then not all data are being fetched.
thanks
Edited by: Bhat Vaidya on Sep 28, 2010 8:33 AM -
Key Figure in cube loaded zeros, Strange problem
Cube with three key figures
1)counter(for each record, CONSTANT 1)
2)Count with Exception aggregation (CONSTANT 1)
3)NO OF DAYS
NO OF DAYS is calculating and displaying correctly, where as other two key figures in the cubes are zero (backend cube data as well as query).
Working fine in DEVELOPMENT AND NOT IN TEST.Hi TR,
Pls do activate the update rules in test. Also check the update rules display. I hope the reason for this problem is the 'update type' set to 'no update' for the keyfigure.
Hope this helps...Let me know
Regards,
R.Ravi -
Sort the Key Figure and put a count on it
Hi Experts,
I have a situation where I have to sort the value of the Key Figures in ascending order and put a count on them.
Kindly elaborate me a little on this.
Thanks in advance,
KannanHi Kannan,
If you want to do this setting at the Query Designer level, then select the Properties section for the
desired Key figure say K1.then select the "Calculations " tab. Under the Local calculations for "Calculate Results as" select "Counter for all detailed values".Save the query.
Open the query (say) at Bex Analyzer. From the context menu for the key figure K1, select "Properties"-->then under Sorting tab select the required order.
The options mentioned above, i.e "calculations" and "Sort" is available on web too in the context menu for the key figure.
The above mentioned setting wil be a display setting>You can modify it as per your requirement at Query Designer.
NOTE:
If your requirement is such that K1, should always display the counter , then while creation of the K1 itself , you can select the Exception Aggregation of Type "Counter(all values)". Then, the setting will be permanent.(design time)
Hope the information helps!
Best Regards,
Akshata
Edited by: Akshata Shenoy on Jun 2, 2009 12:25 PM
Edited by: Akshata Shenoy on Jun 2, 2009 12:27 PM -
Key Figure value in Cube showing with extra zeros
Loaded data into the cube. When I display the result
Key figure values are showing with 2 extra zeroes and Quantity value shaowing with 3 extra zeroes.
Original value
Price, Quantity, Sales Rev
2 1 2
3 2 6
When display value from cube
Price, Quantity, Sales Rev
2,00 1,000 2,00
3,00 2,000 6,00
Why zero is showing? How can I display the original value? In PSA, values are showing correctly.
Thanks,Hi,
These are the zeroes after the decimal places. this is the property of the key figure.
In your report you can change the display value. In the display properties of the Key figure under the number of decimal places make it as 0. This will remove the zeroes.
Hope it helps.
Regards,
Gaurav
Edited by: Gaurav Kothari on Oct 16, 2008 10:35 AM -
Currency Translation with a Calculate Key Figure
Hi,
Does anyone have experience with applying currency translation in BEX/Query Designer on a Calculated Key Figure?
I have a need for a calculated key figure to be converted to a target currency of USD (which is already defined via RRC1). I also need the Results Row to display the summation in USD.
Currently, my calculated key figure displays two currencies (MYR and USD) and an incorrect summation of both currencies.
Here is how I have defined my calculated key figure:
NODIM ( 'Consumption (STOs)' ) * NDIV0 ( 'Material Source Plant Cost' / NODIM ( 'Source Plant Price Unit' ) )
I am multiplying a quantity field by amount field and then dividing by a price per unit field. I have applied NODIM on the other fields so that the amount field will retain it's properties.
Running this query through transaction RSRT and clicking on the Generate Report button, I get the following message:
"<b>Currency translation cannot be carried out for element 20 (my calculated key figure). Element 20 neither contains a Basic key figure nor a variable with type Amount. For this reason, you cannot and do not need to perform a currency translation</b>."
From the above message, I must be setting my calculated key figure incorrectly.
Any ideas?
Thanks!
HauHello Ajeet and N Ganesh,
Thank-you for your help. I verified that the dimensions of my key figure 'Material Source Plant Cost' was of type 0AMOUNT, so that was not the issue.
The issue was in the error message that was returned when I pressed the Generate Report button in RSRT. Essentially, currency conversions in BEX can only be performed on basic key figures or simple replacement path variables.
I can perform the currency translation on a SIMPLE calculated key figure that contains only the replacement path variable (where 'Material Source Plant Cost' is an attribute of my master data characteristic ZMAT_SRC). However, I found that I cannot perform the currency translation on COMPLEX calculated key figures, like in my example above.
To get around this currency translation issue and as suggested by the error message, I created a SIMPLE calculated key figure for replacement path variable 'Material Source Plant Cost' and performed the currency translation. The problem with this solution is that while I get my currency translation, I also get a calculated key figure that is aggregated, according to the query layout.
To get around the aggregation issue, I also created a dummy counter as a master data attribute (of ZMAT_SRC) to capture the aggregation. I assign a value of 1 to this dummy counter/master data attribute in the update rules to my ZMAT_SRC infoobject.
I then divide my new (aggregated) calculated key figure for 'Material Source Plant Cost' by the dummy counter (which is also aggregated). Essentially, I divided the aggregated replacement path variable by the scaling factor. The result is that I get a new calculated key figure that has been translated into the target currency and in the correct scaling factor. I can use the new calculated key figures in the above formula; regardless of the report is rolled-up.
Again, thanks for your help. It gave me the pieces to solve this puzzle. -
Hello,
I have a report which shows the late deliveries. The no. of days late comes as a key figure. I want a report where it shows the count of no. of deliveries which are late by <10 days or greater than 10 days.
Basically its like a counter on the Keyfigure. So my report would look like
Late by 1 - 10 days - 20
Late by 11- 20 days - 30
Any inputs would be highly appreciated and rewarded.
thanks,
KKHi KK.
This can be solved at query level. I.e. late by 1 - 10 days:
('KF'>0 AND 'KF'<=10)*1
The expression 'KF'>0 will if true be 1 and if false 0.
Hope this helps.
BR
Stefan -
Count the number of business partners on a non-cumulative key figure
Dear experts,
I have a problem. We have an InfoCube in BW in which the Activity Journals are loaded every day. In this Activity Journals it is registered that a Material was listed (available) at a customer (value 0 or 1).
We have a non-cumulative key figure MXW_LISTN with inflow (MXW_LISTI) and outflow (MXW_LISTO). In time this key figure receives +1 or -1 for a customer, material combination.
I want to use MXW_LISTN in the query in a specific way. The key figure on itselve tells me how many listings there are. However, I want to know how many business partners there are with a listing.
I was thinking about an exception aggregation on MXW_LISTN with reference characteristic 0BPARTNER and "Count <> 0". BW however refuses to do so and only lets me do simple aggregations such as AVG, MIN, MAX etc.
Can you think with me and come with an proper solution to count the number of business partners with a listing?
Your help is very much appreciated and rewarded!
Best regards, Hans de KleinWould anything with virtual key figures be a solution? Please help me out!
Best regards, Hans de Klein -
How to calculate the key figure value on other key figure
Hi,
I have a material character and Packing Hour, No of Boxes key figures. My requirement is i need to calculate the % no of boxes are Packed <2 Hour , 2 to 3 Hour and above 4 hour based on the packing hour.
Sample data
Material Packing hour No of boxes
001 1 hr 5 box
002 2 hr 3 box
003 2hr 7 box
004 3hr 2 box
005 5hr 1 box
Here we are not considering meterial. We are considering Only Packing hour and no of box to calculate % no of Boxes within a time period. Please help me out...to calculate % no of boxes based on hour period
Thanks,
Rama Devihi
its like creating buckets for analysis...
u'll have to create formula in KF...
1.
if (Pack Hrs <= 2) * No Of Boxes
2.
If (Pack Hr >= 3 or Pck Hr <= 4) * No Of Boxes
like this u'll have to create bucket.. -
How to calculate key figure before aggregation for complex formular?
Hi, buddies
<b>Here's the simplified senario</b>:
I have a cube, in which the characteristics are 'Calendar Day' and 'Hour' (values are 01~24), and the key figures are stored by day and by hour.
What I need is very simple, a query to display calculated key figures only by Calendar Day. I don't need Hour information.
So I create a query: column charact is Calendar Day, rows are several calculated key figures.
<b>Now the problem is that</b>:
if I don't put 'Hour' as row in the query, I'll get WRONG result. But if I put 'Hour' as row in the query, I'll get CORRECT result, but all the 'Hour' details will display, which should be hided.
<b>I know the reason is that</b>:
the calculated key figure that I create should be calucated before aggregation, not after. But since the formular is pretty complex, I can't change the 'Time of Aggregation Calculation' in key figure's property. (It's greyed out.) So I have to put 'Hour' as row in the query to force calcuation 'before aggregation' in query and set the property 'Calculate Result As...' as 'Summary'.
<b>My question</b> is:
whether there's any other way to force calcuation 'before aggregation', so I don't have to put 'Hour' in the query.
If no, is there a simple way to hide the 'Hour' details and only display summary result ON THE QUERY LEVEL? (
<i>I can hide detail lines by using web template, or maybe using VB in excel. But I can't use either of them. I want to hide the details on the QUERY LEVEL. So I can use the query directly in any other reporting tools, like Visual Composer.</i>)
Any idea?
WeiHi, Sudeepta
Thanks for your reply.
I did try to set 'No display' for 'Hour'. The result is that the Characteristics 'Hour' doesn't appear on the query result, but the detailed line of key figures still display on the result. It looks like the followings: (I put summaries on the top/right)
Date 1/1 1/2 Overall result
KPI1 10 11 22 (sum line)
KPI2 20 21 41 (sum line)
KPI1 12 13 25 (detailed line)
KPI2 13 13 26 (detailed line)
KPI1 11 12 23 (detailed line)
KPI2 12 12 24 (detailed line)
I want to suppress all the detailed lines and leave sum lines on the result.
Maybe you are looking for
-
Multiple accounts with one computer/email
My 2 children and myself are getting iphones and need to each have an itunes account. I have one already the whole family has access too, but I need to create 2 more accounts, but would like to use the same email address. How do I do this (the easi
-
Lack of Ram and Leopard= tragic
I just got the new Leopard as an early xmas-present along with a 500GB external hard-drive and the new slim keyboard. I currently have a iMac OS X version 10.3.9, PowerPC G4, 1.25 GHz, 256 MB, and Bus Speed: 167 MHz. I attempted to install Leopard an
-
Forcing Acrobat to display a PDF with an accuracy of a single pixel
This is a bit strange question, I didn't know where to put it... I'm developing a program for creating a pdf from a GUI interface sample. This means that I need to replicate what is in the GUI to the PDF EXACTLY. And when I say that I mean to the pix
-
Time Machine screen is not opening
When I select "Open Time Machine Preferences..." provided by the Time Machine icon or upper bar icon, the screen would not open. It was working perfectly! the other options: "Backup Now" and "Enter Time Machine" are working without a problem. I can p
-
Photo Collage - Which Product?
Morning All! There was a special offer here with Groupon for printed canvasas, I've stocked up as there were a couple of images I always wanted blown up to +/- A1 size. However, I bought more than I needed. With the couple I have left, my plan is t