add numbers with specific category from other app
AnsweredHi there, simple request (hopefully):
App1 - calculation field
App2 - category field (a,b,c) & number field
How can the calculation field in App1 add together all of the number fields in category (a) from App2?
I tried the following script:
var val = @Sum of number;
var cat = @All of category;
cat.indexOf("a") >= 0 ? val : 0
Won't work - it adds all number fields together without asking for the category.
Thanks so far.
-
Hej Rainer, thanks again for your fast support. I really appreciate it.
You where right, it works. As you know, when you type "@All of" the calculation field shows possible fields. Number fields are not listed then. When I type the name of the number field, the advices under the field are gone and they do not show up any more. So it's just a word in the end and Podio doesn't connect to the number field. I where able to make it work by typing "@All of" and then past the name. In this case the calculation field shows the the number field as a possible connection. Maybe it's a Safari bug. Is this normal? Do you have the same issue?
-
Hi Jan,
don't type @all of , but @NumberFieldName, than you should see a list
sum of
avg of
...
all of
for this number field. That works for me in Chrome and Firefox (Windows). It's always faster to type the field name and than to select the right format from the list instead of @all of fieldnameRainer
-
Thank you very much for the advice. That works.
That was a lot of talk for a small basic thing i didn't know. I think a short tutorial for calculations would be great. I'll post that as a "feature request". The calculation introduction video doesn't really teach the basics and the support told me, that there is nothing in coming.
Thx, Jan
-
Podio won't do any support for Javascript issues, which is understandable. Here I always find heplful tips and examples (besides Google Search):
http://www.w3schools.com/js/default.asp
http://stackoverflow.com/
http://momentjs.com/docs/Rainer
-
Hello, Jan and Rainer. I tried this calculation and keep getting the error "The result is not a valid number." I have tried all 3 ways, using "total", "+total" and "parseFloat(total)" with the same result.
Here is my calculation:
var val = @All of Negotiated Price (Number); //this is a number field
var cat = @All of Status; //this is a category
var total = 0;for(var i = 0; i < cat.length; i++){
if(cat[i] == "Won"){
total += val[i];
}
}
totalWhere have I gone wrong? Thanks for your help. :)
Please sign in to leave a comment.
Comments
11 comments