Racmitch
Member
I am again working with the calc element. I thought I had it figured out, but still getting the wrong number in the total when I do a % total.
The actual math is (numbers are just what I'm using as a sample) 100 -75 / 100 * 100 to equal 25%
now I have to add the fields from each equation to get those totals. example to get the first 100 I am adding fields 1,2,3,4 to = 100, then adding the 3 fields to get the 75 that I am subtracting from the initial 100, then adding the field to give me the divisible number of 100 and then finally multiplying by 100. my formula looks like this:
Adding for the 100
return ((float)'{monthly_expenses___expamount_raw}' + (float)'{monthly_expenses___expamount2_raw}' + (float)'{monthly_expenses___expamount3_raw}' +(float)'{monthly_expenses___expamount5_raw}'
adding to get my subtraction number of 75
- (float)'{monthly_expenses___expamount2_raw}'+ (float)'{monthly_expenses___expamount3_raw}'+ (float) '{monthly_expenses___expamount_raw}')
Adding to get my divider of 100
/ ((float)'{monthly_expenses___expamount_raw}' + (float)'{monthly_expenses___expamount2_raw}' + (float)'{monthly_expenses___expamount3_raw}' +
(float)'{monthly_expenses___expamount5_raw}')
* 100;
but I get a final % total 125 and it should be 25%
all fields are using 25 for my test and it's 4 fields that are calculating so it's easier to know my answers, they would be either 25,50,75 or 100.
The actual math is (numbers are just what I'm using as a sample) 100 -75 / 100 * 100 to equal 25%
now I have to add the fields from each equation to get those totals. example to get the first 100 I am adding fields 1,2,3,4 to = 100, then adding the 3 fields to get the 75 that I am subtracting from the initial 100, then adding the field to give me the divisible number of 100 and then finally multiplying by 100. my formula looks like this:
Adding for the 100
return ((float)'{monthly_expenses___expamount_raw}' + (float)'{monthly_expenses___expamount2_raw}' + (float)'{monthly_expenses___expamount3_raw}' +(float)'{monthly_expenses___expamount5_raw}'
adding to get my subtraction number of 75
- (float)'{monthly_expenses___expamount2_raw}'+ (float)'{monthly_expenses___expamount3_raw}'+ (float) '{monthly_expenses___expamount_raw}')
Adding to get my divider of 100
/ ((float)'{monthly_expenses___expamount_raw}' + (float)'{monthly_expenses___expamount2_raw}' + (float)'{monthly_expenses___expamount3_raw}' +
(float)'{monthly_expenses___expamount5_raw}')
* 100;
but I get a final % total 125 and it should be 25%
all fields are using 25 for my test and it's 4 fields that are calculating so it's easier to know my answers, they would be either 25,50,75 or 100.