You don't need a script to get the total value of each field. A summary field can compute the total for you.
What kind of chart are you trying to create?
You can use a calculation with the list function to put the totals for this into a a data series:
List ( Main::sTotalIRL ; Main::sTotalLK ; Main::sTotalDP ; Main::sTotalKS ; Main::sTotalNp )
Each of these would be summary fields.
To create a data series for the labels, use:
List ( "IRL" ; "LK "; "DP" ; "KS" ; "Np" )
I am trying to create a pie chart from a table that has 138 fields, and I am trying to avoid adding more.
That’s why I created the script step, being that it will have maybe 10 or 12 similar charts, with different fields, so that will be a lot of summary field
Sounds like you have a lot of fields where you should have separate records.
Either you have a lot of added summary fields or you have a lot of global variables and potentially lengthy delays brining up your chart.
Using your scripts, you can put the global variables inside the List function where I had summary fields. (And these expressions are not for calculation fields for your table, you can use the "calculation option" and specify the calculations in the chart setup.)
Unfortunately, that was the only way that the table could be built, trust me, I tried to reduce it as much as I can!
It’s a sort of a 3 page questionnaire form, with a terrible set of answers, and there is nothing I can do to change them, apart from dividing it in to 3 separate tables with an primary key connecting them....
But if bunch of scripts with 5-6-7 global variables will make it slow and buggy, I will have to add sumarry fields...
A questionaire should be structured with one question in each record with a related record for recording each response to each question.
See this thread: Need aid on generating a report from a survey layout.
I have went through that thread a few days ago, and I regret to say, at this point, it is too advanced for me... Is there an example file for that survey database?
Anyways, this conversation of ours have open my eyes for a different approach, and I will remove 7 of the biggest questions out of original table, and move them to separate tables, with a relationship to a original one, which will give me more freedom with summary fields!
Thank You my friend! :)
I don't have a demo file at this time--that might be a good idea to set up some time in the future, but you are welcome to ask any specific questions about it that you might have.
Back on this subject, I need a bit of urgent help here...
I have created summary fields with totals of the before mentioned LK, IRL, DP, KS, and NP fields, and I have tried the List function, and what I get is in the picture! What am I doing wrong?
And when I put the List("LK";"IRL";"DP";"KS";"NP") he just repeats the names of fields over and over again, and there is no chart.
I need to see exactly how you have set up your chart.
Enter layout mode.
Double click the Chart object and post a screen shot of the chart set up dialog that appears.
OK, here is the screen shot, ignore the field names, being thet LK, IRL and so on were simplified names, cause database is not in English!
Thanks for helping!
Change the Use Data From setting from "Current Founc Set" to "Current Record (Delimitted Data).
I dont know what to say but thanks!
You are a life saver! I know I ask a lot of qestions, but I am learning, and thats the only way to learn!
Thank You for helping every time!
Yet again, I have to say thank You with the another question!
Is there a vay to make a multiple field pie chart, but with a found set! Tnx.
I suppose so, but the devil is in the details.