Library 1
Name: Exam
fields:
Exam - Text
Grade - Real
CP - Real
GradeByCP - calculation: #{grade}*#{cp}
Library 2
Name: GPA
fields:
AcademicYear - text, or whatever you want.
Subjects - Link to entry - many to many - library Exam
GPA - calculation field #{subj...@sum.gradebycp}/#{subj...@sum.cp}
Fill in Library 1 with your exam names, grades and grade weights
In library 2 enter Academic year 2016 as the name of the field, for example.
In the link field, select the exams you want to be included in your GPA.
Close the editing mode and see the result.
For esthetics, in the *first* library called Exam - you can edit the link fields and make them invisible.
Thanks, Zhenya (still guessing).
-bc
The fact is that there are prices to pay for designing against nature. The downsides of cramming into one library are several, but mainly include redundant data that is then hard to update when needed and hard to keep in sync among the copies.
The thing is, once libraries are linked, you can both aggregate across the libraries and you can reference fields in the linked library from the linking library, so you can still do all your slicing and dicing from one library without having to duplicate the data.
I suggest the following libraries: Teachers, Students, Courses, Terms, Classes (association of a teacher taking a course during a term), Grades (per student per class). Then, you can suck everything into Grades from the other linked libraries and slice and dice to your heart's content, but you can update everything in its natural place.
Sometimes people need other operations between aggregated fields... Now, other operations on aggregated fields are accessible only kf you use a second table.
Wouldn't it be great to propose the programmers to extend the functionality of aggregations as to be able to make operations between aggregated fields too? A kind of Calculation field for the aggregation row...
I know it will be quite easy to do, considering that Memnto has already calculation and javascript functions. All they need to do is to add these same calculated functions to the row of aggregations. That would resolve a great many issues of making final reports, and will be a big step to make memento produce database versatile consolidated reports...
The aggregations are not needed, but probably desirable:
- aggregation Sum field Grade
- aggregation Sum field Credit Points
The values agree with Alex's. You do have to populate the link for each entry, though.
After so long, I can't tell you more without going back through and reconstructing it.
please help,
im stucked to this sum field in the library itself.
i tried to do advise from eugene and bill, from this forum and wiki, but still get stucked
cant get sum total of field, without using aggregation.
just need to be able to sum the 1 field ( column ) to make calculation based on that summed value.
like this:
item |qty |unit price |amount
pen | 1 | 10 | 10
book | 2 | 20 | 40
total amount:*stucked | 50
how to make that?
thx sirs and best regards
adi kwok.
Field amount, type JavaScript, script...
field("qty") * field("unit price")
So, now, where do you want this total of the amounts? Storing it as a field doesn't make sense, because its value is a total across all entries, not a value of a given entry. But you say you don't want aggregation? But that's where such a total belongs.
If you want code, I can write a quick action to calculate the total, but what? Write that to a file? Or what? Here's the code for a library action called "Sum of amounts"...
var lib = lib();
var entries = lib.entries();
var sum = 0;
for (ent = 0; ent < entries.length; ent++)
sum += ent.field("amount");
// OK, now what? Since I don't know what, I'll display a message with the total.
message("Sum of amounts is " + sum);
I think you really want to use aggregation but think you don't for some reason. With aggregation, the total will show up in all lists of entries, if filtering, then only for the filtered entries, if grouping, then a grand total plus a subtotal for each group. Why don't you want to use aggregation? I recommend it.
this memento aggregation is rock.
especially when use with group, filter and sort.
your recommending is highly precious and appreciated from me. bill, sir.
now i knew that aggregation is doing the things more than what im looking for. it was your replied which made me knew about ' grand total by each separated subtotals '
best regards.
adi kwok
.
.