FAQ: Difference between revisions

162 bytes added ,  26 July 2016
no edit summary
No edit summary
Tag: Mobile edit
No edit summary
Tag: Mobile edit
Line 146: Line 146:


== Calculations ==
== Calculations ==
=== Can I use JavaScript for my calculation? ===
Yes, use the JavaScript field type. The final value assigned will be the result of the Calculation.
=== Can I use calculations for multiple fields? ===
=== Can I use calculations for multiple fields? ===
Yes, Memento can perform an array of calculations:
Yes, Memento can perform an array of calculations:
# Within the library creation, add a ''Calculation'' field type
# While creating a library, add a ''Calculation'' field type
# Within the Expression sub-section add either field or function and operator(s)
# Within the Expression sub-section, add either field or function and operator(s)
An example (quantity x price): #{price} * #{quantity} the resulting field would be the total.
An example (quantity x price): #{price} * #{quantity} the resulting field would be the total.


=== Can I find the total value for a specific field within a library? ===
=== Can I find the total value for a specific field within a library? ===
Yes, Memento can display the sum total of a specified field:
Yes, Memento can display the sum total of a specified field:
# Within the library edit screen, select ''Aggregation'' tab > click on '''+''' button.
# Within the library edit screen, select the ''Aggregation'' tab > click on the '''+''' button.
# Select the function ("Sum").
# Select the function ("Sum").
# Select the field required.
# Select the field required.
Memento allows for a custom string to be displayed (example “Total:”) and can be aligned left or right and is displayed at the bottom of the library list view
Memento allows for a custom string to be displayed (example “Total:”) and can be aligned left or right and is displayed at the bottom of the library list view.


=== Can I perform calculations with dates & times? ===
=== Can I perform calculations with dates & times? ===
Yes, there are a few formulae that can be used to calculate dates:
Yes, there are a few formulae that can be used to calculate dates:


* To calculate a date by adding days, months or years to a given date use: dateadd(#{date1},d,m,y) where #{date1} is the value of a date field and d,m,y are integers.
* To calculate a date by adding days, months or years to a given date, use: dateadd(#{date1},d,m,y), where #{date1} is the value of a date field and d,m,y are integers.
* For date/time calculations use: dateadd(#{datetime1},s,m,h,d,m,y) where #{datetime1} is the value of a date/time field.
* For date/time calculations, use: dateadd(#{datetime1},s,m,h,d,m,y), where #{datetime1} is the value of a date/time field.
* To calculate the number of days between two dates, use: datediff(#{date1},#{date2})  
* To calculate the number of days between two dates, use: datediff(#{date1},#{date2})  
* To calculate the number of seconds between two date/time values use: #{datetime1}-#{datetime2}
* To calculate the number of seconds between two date/time values, use: #{datetime1}-#{datetime2}


== Privacy ==
== Privacy ==