Calculate average from values in database, then show output in UI labels
Thank you. I made the change and now I'm getting the average as an alert when I'd like it to show up on one of my labels on the UI
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Thank you. I made the change and now I'm getting the average as an alert when I'd like it to show up on one of my labels on the UI
Run this:preAppery("labelName").text(val);/pre
where should I run this? from events, within query service or on 'search' button?
Hi -- in the code that Marina advised, in the last line:
pre
...
alert(val);
/pre
change to:
pre
Appery("labelName").text(val);
/pre
This doesn't work at all. No output shows up on the label.
Are there any error in browser console http://docs.appery.io/documentation/d...?
I'm going to review everything one more time. I didn't think what I was trying to do would be so complicated. It's taken me 3+ days to complete this 1 feature. Seems like such a fundamental feature for an app.
1) Query database on variable X and
2) return average for selected values for var Y and average for selected values for var Z
3) post the output to UI labels 1 and 2
Is my request terribly complicated? I'll review each of your steps again.
ok I think I'm close to a fix. I see output on 3 labels, but the average is not calculating correctly. Also, how can I make a heading for each of my columns. Is there an error in my js? I can't find it.
var val=0;
if(data.length) {
Code: Select all
for (var i=0; im calculating average for two variables