Counting a Char in relation to KF
Hi
I Have the following fields in my report.
Account # >Char
Open Amount > KF
of Invoices > Char
I need to get the '# of Invoices' with a Unique 'Open Amount'. For example if there are 40 invoices each with an open amount of $15.40.
Your thoughts appreciated
Message was edited by:
xcaliber
Message was edited by:
xcaliber
This is not possible in Bex.
This would not be a regular business requirement I assume.
To trace such invoices, you may want to do SE16 on F or E table, get the DIMIDs for the invoice no dimension, go to the dimension table with these DIMIDs to get the SIDs of the invoice no, and finally to the SID table to get the actual invoices.
If SE16 doesn't allow you to select on a number, you may have to do this using ABAP.
Or do a Bex report with all invoice no / amount and then do a search in excel itself for the values you are interested.
cheers,
Similar Messages
-
Query: Count a char with respect to another char
Hi,
In the query I would like to count the "unique occurances" of a characteristic with respect to another "characteristic". The value should be fixed ipprespective the drill down state of any other char. Any ideas?
Example: I have Material and Customer. and material is in many orders... I would like to get number of Materials a customer has ordered. Well, this can be done if only the "Customer" is in drill down. But, I have customer, material and some other characteristics in the drill down. At any drill down state, I would like to know number of materials ordered by a customer.
I already went thru the white paper, "Count the occurrences of a characteristic relative to one or more other characteristics". This works only when "Customer" is the only object in the drilldown. Doesnt work when additional chars are in the drill down too...
Thanks
GovaAshish, thanks for the response.
Here is the detailed example.
initial view:
Customer Material Count
001 abc 5
after expanding by material group, it should show
Customer Material Mattype Count
001 abc xyz 5
001 abc pqr 5
if I expand by Sales Order also, it should display the same
Customer SalesOrder Material Mattype Count
001 345 abc xyz 5
001 345 def pqr 5
001 678 abc xyz 5
001 678 def pqr 5
Whatever the drilldown state may be, I am only interested in "How many distinct values of Material" did a Customer order.
thanks -
Counting Lines/Char/Words in a txt file
I created this method that counts the mount of lines/words/ and char in a file. But for somereason, its not working correctly. Its giving me numbers that are a little off.
// Method countLineWordChar counts the number of lines, words, and chars, in
// a file given as a parameter. This method returns an array of intergers. In
// the array, the first position is the amount of lines, the second posistion
// is the amount of words, and the third is the amount of chars.
public static int[] countLineWordChar(File f)
int[] countInfo = new int[3];
int lineCount = 0;
int wordCount = 0;
int charCount = 0;
try
FileReader fr = new FileReader(f);
StreamTokenizer st = new StreamTokenizer(fr);
st.eolIsSignificant(true);
while(st.nextToken() != StreamTokenizer.TT_EOF)
switch(st.ttype)
case StreamTokenizer.TT_WORD:
wordCount++;
String wordRead = st.sval;
charCount += wordRead.length();
break;
case StreamTokenizer.TT_EOL:
lineCount++;
break;
default:
break;
catch (FileNotFoundException fnfe)
UserInterface.showFileNotFoundError();
catch (IOException ioe)
JOptionPane.showMessageDialog(null, ioe.toString(), "Error",
JOptionPane.ERROR_MESSAGE);
countInfo[0] = lineCount;
countInfo[1] = wordCount;
countInfo[2] = charCount;
return countInfo;
// Based on the countLineWordChar method, returns the amount of lines.
public static int getLineCount(int[] countInfo)
return countInfo[0];
// Based on the countLineWordChar method, returns the amount of words.
public static int getWordCount(int[] countInfo)
return countInfo[1];
// Based on the countLineWordChar method, returns the amount of chars.
public static int getCharCount(int[] countInfo)
return countInfo[2];
}Well, for one thing, you're adding the number of characters in words, not the number of characters overall. Are you sure it's not supposed to be the latter?
Otherwise, how is it off?
Basically the way you fix this kind of thing is to add debugging code, then give it a small data sample and watch the debugging messages.
By the way, returning an array of different kinds of values like that isn't ideal. In this case it's not so bad, because the kinds of values are actually really similar -- they could be viewed as a tuple. But don't make a habit of it. An example of a bad application of this would be if you were returning an array that counted, say, the weight of a ship, the length of its hull, and the distance it travelled in the last year. The alternative is to create a class that encapsulates the data being returned, or to move functionality around so the data isn't being returned at all. -
Graph on overall result in WAD &Counting on chars
Hi,
I have 2 characterstics Company and Customer for which I have given the datatype as CHAR
For example I have total no of companies = 100 out of these 75 companies are Oracle Customers
Now I want to calculate 100/75*100 which give the %
Company _____ Customer
Amro Holding Yes
Edwards ______Yes
AMMB s ______ No
ATEbank ______Yes
Sie ______No
In the above example total no. of cos are 5 out of 5 companies only 3 are customer of Oracle . How can I count the values for the characterstic&how can this overall result data needs to be represented in the bar graph in WAD
Please let me know how can I work on this
Thanks
Mayaare you r using wad 7.0 or 3.5
in 7.0 right click on the graph, edit nyou wil be in the wizard go on step 3 and try to change the series and make sure visilibility is checked
if this doesnt work then click refine and go to series and make sure show lables are checked.
try this. -
PDF Page count question (not coding related)
Vista has numerous types of details it can display and sort with (size, date modified, etc.).
I found "pages" in that list but it doesn't seem to be intended for pdf files.
Can windows (or another software solution) display the page count of individual pdf files when viewing a folder containing multiple pdf's? If so, how do I get that rolling?
Thanks.
JakeCoachW:
Welcome to the Apple Discussions. You're right, the minimum number of pages is 20, single or double sided. You will get 4 blank pages at the end. You can check it out by going thru the ordering process and after the book if finished assembling and you're at the next window, do the following to find and copy the pdf file that iPhoto creates to upload and print:
How to Find the iPhoto Generated PDF File:
1 - Start the ordering process and stop after the book has been assembled and you get to the Order pane where you select the cover color, copies, etc.
2 - Go to the Finder and select the Go->Go to Folder menu item (CommandShiftG).
3 - copy the following, “/private/var/tmp/folders.501/TemporaryItems/iPhoto” (for Panther the path is "/private/tmp/501/TemporaryItems/iPhoto“), and paste into the Go to Folder search box.
4 - the iPhoto folder will be brought up. In it will be the PDF file that was generated by iPhoto. You can copy it (Option-drag) to the Desktop to review and/or save.
Note: the iPhoto folder will not exist before you start the ordering process and is deleted after the order is completed or after you cancel the order and quit iPhoto.
You can then cancel the operation if you're not happy with the result. -
char c = '\u000d';
char d = '\u000a';
char e = '\u0000';
char f = '\uface';
first two statements are giving compilation errors! Im unable to resolve the problem! Please help me!
Thanks in advance!I prefer these forms:
char c = (char)0xd;
char d = (char)0xa;
.. -
Help with program using hashtable to count words & other chars in txt file
I need to use only a hashtable to count the occurences words and chars in a text file and display them alphabetically. I am not to use anything but the hashtable. so far, I can get it to count only the words in the file and not the chars, I want to know how to make it count the chars (,.;:?(){}[]!@#$%^&\t\"<>/`~ ) that may be found and if it is possible to get it to display them in a sorted (alphabetical) order w/o using anything else.
This is what I have: mport java.io.*;
import java.util.*;
import javax.swing.JOptionPane;
class words{
String word;
int count;
public class WordCount{
static Hashtable h=new Hashtable();
static words w;
static void countWords(String s){
if((w=(words)h.get((java.lang.Object)s))==null){
w=new words();
w.word=s;
w.count=1;
h.put(s,w);
}else{
w.count++;
h.remove(s);
h.put(s,w);
public static void main(String args[]){
String s;
StringTokenizer st;
String t;
String fn = JOptionPane.showInputDialog("Enter the filename:");
BufferedReader br = null;
try{
br = new BufferedReader(new FileReader(fn));
s=br.readLine();
while(s!=null){
st= new StringTokenizer(s, " ,.;:?(){}[]!@#$%^&\t\"<>/`~ ");
// Split your words.
while(st.hasMoreTokens()){
t=st.nextToken();
countWords(t);
s=br.readLine();
}catch(Exception e){
e.printStackTrace();
Enumeration e=h.elements();
w=(words)e.nextElement();
while(e.hasMoreElements()){
System.out.println(w.word + " " + w.count);
w=(words)e.nextElement();
System.exit(0);
}Please don't crosspost. It cuts down on the effectiveness of responses, leads to people wasting their time answering what others have already answered, makes for difficult discussion, and is generally just annoying and bad form.
-
A quick way to count the number of newlines '/n' in string of 200 chars
I am trying to establish the number of lines that a string will generate.
I can do this by counting the number of '/n' in the string. However my brute force method (shown below) is very slow.
Normally this would not be a problem on a 2800mhz Athlon (Standard) PC this takes < 1 second. However this code resides within a speed critical loop (not shown). The code shown below is a Achilles heal as far as the performance of this speed critical loop goes.
Can anyone suggest a faster way to count the number of �/n� (new lines) within a text string of around 50- 1000 chars, given that there may be 10 � 100 newline chars. Speed is a very important factor for this part of my program.
Thanks in advance
Andrew.
int lineCount =0;
String txt = this.getText();
//loop throught text and count the carridge returns
for (int i = 0; i < txt.length(); i++)
char ch = txt.charAt(i);
if (ch == '\n')
lineCount ++;
}//end forMessage was edited by:
scottie_uk
Message was edited by:
scottie_ukWell, here is a C version. On my computer the Java version (reply 9 above) is slightly faster than C. YMMV. For stuff like this a compiler can be hard to beat even with assembler, as you need to do manual loop unrolling and method inlining which turn assembly into a maintenance nightmare.
// gcc -O6 -fomit-frame-pointer -funroll-loops -finline -o newlines.exe newlines.c
#include <stdio.h>
#include <string.h>
#if defined(__GNUC__) || defined(__unix__)
#include <time.h>
#include <sys/time.h>
#else
#include <windows.h>
#endif
#if defined(__GNUC__) || defined(__unix__)
typedef struct timeval TIMESTAMP;
void currentTime(struct timeval *time)
gettimeofday(time, NULL);
int milliseconds(struct timeval *start, struct timeval *end)
int usec = (end->tv_sec - start->tv_sec) * 1000000 +
end->tv_usec - start->tv_usec;
return (usec + 500) / 1000;
#else
typedef FILETIME TIMESTAMP;
void currentTime(FILETIME *time)
GetSystemTimeAsFileTime(time);
int milliseconds(FILETIME *start, FILETIME *end)
int usec = (end->dwHighDateTime - start->dwHighDateTime) * 1000000L +
end->dwLowDateTime - start->dwLowDateTime;
return (usec + 500) / 1000;
#endif
static int count(register char *txt)
register int count = 0;
register int c;
while (c = *txt++)
if (c == '\n')
count++;
return count;
static void doit(char *str)
TIMESTAMP start, end;
long time;
register int n;
int total = 0;
currentTime(&start);
for (n = 0; n < 1000000; n++)
total += count(str);
currentTime(&end);
time = milliseconds(&start, &end);
total *= 4;
printf("time %ld, total %d\n", time, total);
fflush(stdout);
int main(int argc, char **argv)
char buf[1024];
int n;
for (n = 0; n < 256 / 4; n++)
strcat(buf, "abc\n");
for (n = 0; n < 5; n++)
doit(buf);
} -
Simulate select distinct count sql logic in query or data model
hello experts,
given prerequisites: DSO with flat table without any key figures - just characteristics (about 10)
the requirement is to produce the table with all possible combinations of those characteristics with counting the hits
- this flat table should be then loaded to another system
exmple
char error| char division| char time|char id xxx xxx xxx xxx xxx
some counter should be implemented and all combinations of 10 characteristics counted
example
char error| char division| char time|char id xxxxx 1
char error| empty field| empty field| |char id 5
etc
the output should be flat table with counts on the right - some fields will be empty depending on combinations to be counted
what is the best way - query with RCF or some SQL statements in Transformation? how to implement the output desired
thanks in advanceThat sounds very odd.
Can you turn on debug tracing by adding
-Djbo.debugoutput=console
to the Java options of your project (Project Properties, Profiles, Development, Runner)?
Then test the query that is output in the log in SQL*Plus and see if you get the same results.
-SteveA (JDev Team) -
Hi
I am reading some old codes from my work and do not quite understand how they are using @count function.
[code]
FIX (@relative("B&R",0),@relative("WBS",0),"Working")
FIX (@children("All_Appr_Year"))
"Counts"
"Working" = @Count(SKIPBOTH, 1, @relative("B&R",0));
ENDFIX
ENDFIX
[/code]
B&R, WBS, Appr_Year, Working are dimension names. counts is a member in account dimension. The code is trying to count how many lines of records is there per B&R for each appr year. I am not sure what is the use of 1 in the @count function. If I write it, I will write is like : counts=@count(skipboth, @range("costs",@relative("B&R",0)). "cost" is another member in account dimension.
Anyone can explain it to me?
ThanksPer the documentation everything past the 'skip' setting is the list of expressions to count. So your "1" is actually being counted, as it is a non-#Missing, non-zero value.
In other words, the function is returning the @COUNT(@RELATIVE("B&R", 0)), plus 1. Note that this is not because the value of that constant is "1", but because it is counted. Putting 999 in there in place of 1 would still produce the same result.
Why you're doing this from a functional / requirements perspective, I can't tell you. And it's a confusing way to write it - maybe there's some subtlety that I'm missing, but I don't see why this couldn't be written as the much more readable:
@COUNT(@RELATIVE("B&R", 0)) + 1 -
Count non missing cells across 2 dimensions
I am trying to get the average of values for the intersection of two upper level members using the @SUM function and the @COUNT functions but the @COUNT function can't return those non-missing values when at an upper level intersection. Are there any other functions that would providel this count? The member formula looks like this...
"Avg bbAudit" = @SUMRANGE("bbAudit",@RELATIVE(@CURRMBR("Organization"),0)) / @COUNT(SKIPMISSING,@RANGE("bbAudit",@RELATIVE(@CURRMBR("Time"),0)));Yes, that returns only the members for that dimension. I need to get the non-missing members across both Time and Organization dimensions though.
lev0_org lev0_org lev0_org lev1_org
lev0_time .7 MI .5 .6
lev0_time MI .45 MI .45
lev0_time .65 MI MI .65
lev1_time .675 .45 .5 ???
I get the averages for lev0_time average for each column in the lev1_time row and the averages for lev0_org averages for each row in the lev1_org column, but I need the average at the lev1_org and lev1_time intersection by averaging all level 0 values for both dims.
Edited by: bhead on Jun 12, 2012 8:03 AM -
How to create counter with charcteristic values using exception aggregatio
Dear Experts,
Can some one help me on the below issue
Requirement : Creating a counter with char ( accounting doucment number) in the query by using exception aggregation & summarize on totals with CKF.
Note : i dont have any keyfigure called counter in my infoprovider
Please let me know how to create it.
I came to know that create new CKF & FV with replacemtn path with IO(Account document number) & use FV in CKF. is this true & works??
Please let me know how i should proceed ahead??
Thanks
SurendraI have resoloved by own
By createin zckf--> fv choosing replacement path with IO as reference and key.
then excepetion aggreation chosen : counter for all detailed values & check the checkbox calucate after aggreagation.
Thanks -
hey yall
I m trying to write myself a program that will count the number of logical lines in a java program. For example, if my input is
ddafa
//daga
daddfa
tab tab tab --tab s meaning white space i ve to skip
eaqr
my program should skip the comments, the white spaces, tabs, newline returns and return me 3.
I ve started thinking and editing and more thinking, and now I'm getting frustrated over how to skip white space.
Also, is there any way to skip white space upto, say a comment, in the middle of the page? Like this
The startsWith("/") didn't work.
Here is my program
public class LOC
public static void main(String[] args)
String file = "a";
int count = 0;
InputStreamReader input = new InputStreamReader (System.in);
BufferedReader stdin = new BufferedReader(input);
try
System.out.println("Enter name of file:> ");
file = stdin.readLine();
FileReader fr = new FileReader(file);
BufferedReader in = new BufferedReader(fr);
String inputLine = in.readLine();
while(inputLine != null)
while(!inputLine.startsWith("/"))
count++;
for (int i = 0; i < inputLine.length(); i++)
char c = inputLine.charAt(i);
if(!Character.isWhitespace(c))
count++;
inputLine = in.readLine(); // to exit the e
inputLine = in.readLine();
}Somebody needs to help please.Thanks to yall for ur quick and helpful responses. I skimmed thru the java documentation, and yes, trim appeared to be useful in skipping white space.
This is what I have accomplished with the addition of trim. I could not get the tricky slashSlashComment() class to work, so I figured out my own.
but...
Now I have another problem. If my input is all consecutive lines, my program runs fine. Forex, if i have
fdaf
mofo
I get an answer of 4, which is perfect.
However, if I have one space between the lines, I lose data!
fdaf
dada
dada
mofo
I get 2 lines.
Could this be due to trim() cutting all the white space between the two lines?
//===========================================================
// LOC.java
// Author: Denem Orhun
// Comp 6700 Software Process
//============================================================
import java.io.*;
import java.util.*;
public class LOC
public static void main(String[] args)
String file = "a";
int count = 0;
char c = ' ';
InputStreamReader input = new InputStreamReader (System.in);
BufferedReader stdin = new BufferedReader(input);
try
System.out.println("Enter name of file:> ");
file = stdin.readLine();
FileReader fr = new FileReader(file);
BufferedReader in = new BufferedReader(fr);
String inputLine = in.readLine();
while(inputLine != null)
String newString = inputLine.trim(); //get rid of the white space
if((newString.length() == 0 || newString.charAt(0) == '/'))
inputLine = in.readLine();
if(newString.charAt(0) == "/n")
inputLine = in.readLine();
else
count++;
inputLine = in.readLine(); // to exit the while loop
System.out.println(c);
in.close(); // close the input stream
System.out.println("Number of lines " + count);
catch(FileNotFoundException exception)
System.out.println("File not found");
catch (IOException exception)
System.out.println(exception);
}I believe I m very close to the solution but I m sure its a very minor error in there. I ve been staring at the screen for lets see, since yall's posts and the screen is starting to blink lol... -
Program to count the no. of times a character occurs in a string.
program to count the no. of times a character occurs in a string.
Say if u have a method :- Countclass(string s,char c) then using this u should be able to count a char ' T' in the string ="TESTING".
So it is appering 2 times.
How to count it.int countChar(String s, char c) {
int count = 0;
for (int i=0; i<s.length(); i++) {
if (s.charAt(i) == c)
count++;
return count;
} -
Invalid volume free block count
I have witnessed this insight from the disk repair report
persistently , lately every day . I have noticed among other
things that the bluetooth is , although active , unrecognised
by any system feature designed for that purpose . The list
of actions I have taken from plist removal , restart with USB
leads removed along with all the other leads , to permission
repair , fsck , disk utility and disk warrior have had some
effect but of little duration . The bluetooth was similarly
affected before the latest OSX system wide update and
recovered system wide recognition before this latest step
back . I am interested in some idea's perhaps indicating
the substance of a persistent invalid volume free block
count referral , and a related or not bluetooth recognition
problem with availability but the system blind to it .
Thanks Frederick
G5 Dual 2 GHz PPC G5 Mac OS X (10.4.4) Seagate 160 G and Seagate 300 Ginvalid volume free block count referral
This from a 10.3.9 kb article: (perhaps not updated).
"The volume free block count is a type of cache of the real information stored in the volume bitmap, and the count being off does not mean your volume is damaged in any way. An incorrect volume block count message (block count changed from X to Y) is an example of this type of message."
-mj
[email protected]
Maybe you are looking for
-
Issue in BAPI_PO_CHANGE
Hi Gurus, I am using the BAPI_PO_CHANGE to change the account assignment categeory from blank to cost center 'K'. The BAPI is throwing an error : "Account 50010101 requires an assignment to a CO object". but I have already passed the CO objects. BTW,
-
File Name Character Limited to 31 - New or something I've done?
I have been using my MacBook Air with Mavericks for ~6 months and just started getting file name size limit of 31 character warnings a few days ago. I have many files saved with much longer file names but now cannot go over the 31 character limit.
-
Good day, I have been try (with no success) since yesterday late evening to update multiple A7600-H devices to android 4.4.2 (Specifically: a7600H_A442_000_016_140627_row). Unfortunately, the OTA updates don't seem to work and neither does the Lenovo
-
Java(TM) Platform SE binary doesn't work on any website, on any browser
I'm on Windows 7 Ultimate 32bit, everything's working fine, I always keep my system clean, I also keep the registry as clean as possible, I have a problem from at least a couple of months, so "Java(TM) Platform SE binary" doesn't work on any website,
-
Any way to do this with sed?
I would like to be able to pipe the output from locate and have sed modify the files locate finds. Is there anyway to do this?