on 10-02-2008 5:50 PM
I looked this up and I did not find any threads that talked about this.
Can any one post an example of a running total formula that only looks for a portion of the field.
I have a field that is {CAWP.WP} in the fiels the text string is 10120430.100 tru .900 ect
I need to omly select the .900 prtion of the field to return the desired report number
Hi John
Create a formula like this..
mid(,1,len()-4)
This will work only if the lenght of the fields that you want to extract is constant.
Hope this helps.
Regards
Ankeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I may have mis-explained my problem.
I inserted a running total to reevaluate after each project number i.e. 10120000
the .100 thru .900 is the code that each of my resources have i.e. 10120000.100 etc.
I am using this field to only evauluate for the .900 so getting the last four didgits is not what i need
the running total sums CAWP.BAC which is the cost of each resource
it (at this time) evaluates with this formula ( I think this is wrong): "900" In {CAWP.WP}
and i have it reseting after group 3.
the problem is how do I tell it to only evaulate "900" out of the CAWP.WP string?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you only need the portion of the field that is after the period (".") then why not simply do this:
split(,'.')[2];
This will give you 900 every time regardless of the length.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No my field length is not constant. Any other thoughts?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John
The above formula will work even if your field lenght is not constant, however it will not work if the number of characters that you want to extract is not constant throughout.
Eg. If you want to extract last 4 characters from the field each time it will work. If this lenght varies it will not work.
Regards
Ankeet
Hi John,
Use this for loop it will work better for your string.
Local StringVar str := "";
Local NumberVar strLen := Length ({Field Name});
Local NumberVar i;
Local NumberVar j;
For i := 1 To strLen Do
(
if {Filed Name} <i> = "." then
For j := 1 To strLen Do
(
i:=i+1;
if {Filed Name} <i> = " " then exit for;
str:= str + {Filed Name} <i>;
j:= j+1;
);
);
str
This will solve your problem.
Thanks,
Ashok
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.