Jump to content
  • 0

Use Calculated Field for Sum in tabular


Question

I'm trying to use a calculated field for a Sum in another calculated field on a tabular datapage (the aggregation won't work for this particular sum, as the sums are for group headers). 

This is a complicated series of totals so hopefully the process can be followed through.

a) I have 2 calculated fields (that are SELECT) to determine some totals and then a 3rd calculated field that 'decides' which one to use for it's own value:

Calculated Field:3

CASE
 WHEN myfield=1 THEN 
        [@calcfield:1]
        ELSE
        [@calcfield:2]
END

I need to now do a Sum for calculated field 3. I've tried a lot of syntax but cant' get it to work (again, I can't use the standard aggregation). Does anyone know how to do this?

 

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

The problem (I get error when trying) is those calculated fields aren't drawing from the same table. Is there a way to put, instead of [@calcfield:1] the actual syntax from calcfield:1 which is:

SELECT

Proposals_Deposit

FROM Proposals Where ProposalID=target.[@field:Items_ProposalID] AND CompanyID ='[@authfield:CompanyID]'

That said, calcfield2 is even more complicated because it's choosing from 3 other calculated fields, in a different View. 

If I can somehow use all sub-SELECTs instead of the [@calcfield:1 or 2] that would probably do it but I don't know how, or if it's possible. 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...