How to use the variables "sum"?

Started by sinus, September 22, 2017, 01:12:55 PM

Previous topic - Next topic

sinus

Hi
In the the help I found this here:

This function calculates the sum of the elements in the given variable. Used mostly with numerical Attributes of type Real or Int.
Examples:

{File.AT.Submissions:Revenue|sum:true} Calculates the total revenue by calculating the sum of all Revenue Attributes of a file.


I cannot find out, how to use this variables correct.
Does it mean, I can select 3 images and all values in the given field (Revenue of the set "Submission") will be added (sum)?
If yes, it works not here.

The help says "calculating the sum of all Revenue Attributes of a file" ... this would mean from one file? But I cannot have two fields in a file, what are identical (revenue).

Hm, sorry, I think, my head is puzzled.  :o

Can someone solve this chaos in my head?  ;D
Best wishes from Switzerland! :-)
Markus

Mario

#1
File.* variables are per-file. One file.
If you have three attribute records in the same set for a file, you can sum them up using that variable.
Same for certain repeatable metadata tags which are numerical and can occur multiple times.

You cannot select several files and then somehow sum up attributes of these files. IMatch is not Excel :D
You can just export the Attributes into the clipboard (e.g. with the cool Copy Data app) and then paste them into Excel.

Or you write a small Excel macro which pulls data from IMatch directly into an Excel work sheet. All possible now, thanks to IMWS.
Or, if you know about such things, you can use Excel's "Get Data > From Web" to directly call an IMWS endpoint and then transform the results as needed. That's advanced though and might require some experiments. But Excel can handle JSON responses from Web Services. All you need to do is to tell it how to convert the result into a table or pivot.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on September 22, 2017, 03:13:43 PM
File.* variables are per-file. One file.
If you have three attribute records in the same set for a file, you can sum them up using that variable.
Same for certain repeatable metadata tags which are numerical and can occur multiple times.

You cannot select several files and then somehow sum up attributes of these files. IMatch is not Excel :D
You can just export the Attributes into the clipboard (e.g. with the cool Copy Data app) and then paste them into Excel.
Or you write a small Excel macro which pulls data from IMatch directly into an Excel work sheet. All possible now, thanks to IMWS.

Thanks, Mario
Hm, I understand.
What I do not understand, how should this work?

The variable from the help:
{File.AT.Submissions:Revenue|sum:true}

I think, the Submissions is the Attributes-Set (per file).
And Revenue? Is this a Attribute from this set?

And if, what can then do the variable, because it is not allowed, to have two or more identical names in the attributes-set.
I tried several possibilities, and got no result, but no wonder, if I do not understand, how to use it.

Hm, sorry, still puzzled, the coin is still not dropped.  :-[



Best wishes from Switzerland! :-)
Markus

Mario

AT = Attributes

SetName.AttributeName

You can have any number of records per set. This is what the variable sums up. The values of the Attribute Revenue for the given file.
If the file has 3 records, the variable will sum up the Revenue Attribute of these 3 records.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on September 22, 2017, 04:47:46 PM
AT = Attributes

SetName.AttributeName

You can have any number of records per set. This is what the variable sums up. The values of the Attribute Revenue for the given file.
If the file has 3 records, the variable will sum up the Revenue Attribute of these 3 records.

Ah!!!
The coin is dropped!  :D

Thank you, Mario, all is clear now!  :)
Best wishes from Switzerland! :-)
Markus

Mario

We also discussed this a couple of week ago when I showed you how you can sum up Attributes in an IMatch App. And there you can of course sum up the values of any number of Attributes for any number of files.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook