Jump to content


Photo

Inserting Calculated Fields in Models or Reports

models fields staff response

  • Please log in to reply
5 replies to this topic

#1 Phoenix

Phoenix

    Member

  • Members
  • PipPip
  • 13 posts

Posted 01 April 2017 - 02:31 PM

Hi,

 

I've been trying to determine whether X2CRM supports calculated fields.  It appears it does since the "Probability" field in one module is used for certain calculations.

 

Is there a way to create a calculated field and add it to a form and / or to a report?

 

Thanks,

 

PHNX



#2 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 04 April 2017 - 09:49 AM

Hello PHNX,

 

Yes, calculated fields are supported through a Field of type "custom," which is configured to use an X2Workflow formula. This will render the calculated value on a model view page, but unfortunately is not yet brought into the fields in reports (it will return empty).

 

To create one of these fields, navigate to the "Manage Fields" page in admin, create a new field for your model, and set the type to "Custom" and subtype to "Formula." Then, you can enter your formula in a syntax similar to Excel, such as:

={dealvalue} * ({rating}/5)

There's also a brief intro to formulas on the X2Workflow user guide: https://www.x2crm.co...anual/#formulas

 

Raymond



#3 Phoenix

Phoenix

    Member

  • Members
  • PipPip
  • 13 posts

Posted 09 April 2017 - 04:49 PM

Brilliant!

 

Thanks so much, Raymond.



#4 Phoenix

Phoenix

    Member

  • Members
  • PipPip
  • 13 posts

Posted 12 April 2017 - 05:51 AM

Hi Raymond,

 

Just a quick follow up:  Can a calculated field reference the results of another calculated field in the same form / module?

 
I used a formula to calculate the profitability of a customer.  Let's say {Revenues} is manually entered per record and {Expenses} equals "{Hours_Worked}*{Price}"; these fields work fine.  When I attempt to calculate a second field dependent on {Expenses}, say "{Revenues}-{Expenses}", only the manually entered {Revenues} results.  Is this normal or a workaround?
 
Thanks,
 
PHNX


#5 X2Raymond

X2Raymond

    Advanced Member

  • Administrators
  • 972 posts
  • LocationSanta Cruz, CA

Posted 12 April 2017 - 01:12 PM

Hi PHNX,

 

No, unfortunately calculated fields can not yet reference other calculated fields. As a workaround, you would need to unfold the inner formula into your outer calculated field to produce the same value. Parentheses are supported for grouping in case the expression is more complicated.

 

Raymond



#6 Phoenix

Phoenix

    Member

  • Members
  • PipPip
  • 13 posts

Posted 14 April 2017 - 04:48 AM

Many thanks for clarifying.







Also tagged with one or more of these keywords: models, fields, staff response

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users