Calculations for category fields, and referencing totals from other apps.
I have an app I am designing that has dealer pricing (higher) vs distributor pricing (lower) and when i am filling out this custom app i need to select between the two. However, when i am trying to calculate my category and number entries it gives me an error that I have selected a text field. Is there a way i am missing to get this to work in my app or will there be a modification coming out where it can be a number/currency category instead of a text category?
-
That seems to have helped inside the initial app. Now I'm trying to grab the grand total calculation of all the calculations for the price list and bring it into another app for a total order. It would seem that it finds every other individual calculation but not the sum of all the calculations. I've tried the delete, and re-add with no luck.
-
I'm not having trouble with the grand total calculation itself. I'm having an issue pulling it out of my "accessories app" into my "Projected order app". When i try to create a relationship entry box and make the accessories app the relationship, it gives me all the pricing boxes and quantities boxes but none of the calculations boxes to create the relationship from.
-
you don' t see the name of a calculation field in the token list when you type @sum of yourcalculationfield? Do you see them when you type @ALL of yourcalculationfield? If you see them when typing @ALL of , but not when using @SUM of your calculation fields are text type, not number type.
-
No, once I've created the relationship field typing @all or @sum it brings up zero results. As soon as I type @ it brings up the entry I have created but I need it to go deeper than just the entry, i need it to reference a specific field in the entry itself. The purpose of the app is to house all 30 of my SKUs so it does clutter my order area, I really need the relationship to pull just one value to be calculated into the Projected Order Total.
It sure be easier to have an area to attach screen shots in these forums. hahaha
-
Dominic, I'm afraid I don't understand your problem.
You can attach screenshots here with a link. Many screenshot apps offer a public link you can share here. If you like you can also send me screenshots to rg@delos-consulting.com.
If you send or attach here please show screenshots of the template creator of both apps and of the items from both apps. -
I'm having this same problem. Here is my setup:
Time cards - have a service, start/end time, and a quantity which is a number field
Bill card - have a service, are linked to multiple time cards, and have a calculation field that sums up all the quantity fields of the time cards (this is working)
Stats - are linked to multiple bill cards, and have a calculation field that looks at the bill cards and if they are set to a certain category field, sums those quantities into a single new quantity (this is not working)
I have tried @all of quantity and @sum of quantity and both are returning 0, when I know that the related bill cards have a numerical value.
Here's my calculation:
var ret = 0,
all_of_quantity = Array.prototype.slice.apply(@All of Quantity),
i,
x;
if (@All of Stats Category=="Scan") {
for (i = 0; i < all_of_quantity.length; i += 1) {
ret += all_of_quantity[i];
}
}
ret; -
Hi Amber,
this should do it:
var ret = 0,
quantity = @All_of_quantity,
statsCat = @All of Stats Category,
i,
len = quantity.length;
for (i = 0; i < len;i++){
if (statsCat[i] == "Scan") {
ret += quantity[i];
}
};
retBut be aware: This works correctly only if the quantity field and the status field in all related items have a value (means: must be a number in quantity and in Status an option has to be selected). And if Stats Category is a single choice catogory field.
Rainer
Please sign in to leave a comment.
Comments
11 comments