Calculations for category fields, and referencing totals from other apps.

Comments

11 comments

  • Hamid

    Try to delete your calculation field and create a new one then test your code.

    0
    Comment actions Permalink
  • Dominic Sartino

    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.

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    Hi Dominic,

    did you try in the grand total calculation

    @Sum of NameOfTheOneCalculationFieldYouWantToSumFromPriceListApp
    

    If that doesn't work, please describe the exact setup (Fieldnames, App names, relations) and which fields you want tu sum in the grand total.

    Rainer

    0
    Comment actions Permalink
  • Dominic Sartino

    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.

    0
    Comment actions Permalink
  • Hamid

    Hi Dominic;
    Have you tried to type : @all of _yourcalculation_Name

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    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.

    0
    Comment actions Permalink
  • Dominic Sartino

    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

    0
    Comment actions Permalink
  • Rainer Grabowski (FVM)

    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.

    0
    Comment actions Permalink
  • Amber Sullard

    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;

     

    0
    Comment actions Permalink
  • Rainer Grabowski

    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];
    }
    };
    ret

    But 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

    0
    Comment actions Permalink
  • Amber Sullard

    Hi Rainer. Thank you so much, that does seem to work! I appreciate it...I ended up doing a very clunky work around and I like this much better. 

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk