Home > Forum > Tips&Tricks > Calculated column report

Calculated column report
0

Hello,

I have an equipment initialization process (1) , followed by another process of allocating this equipment to a user (2).
I have created a Report - "Equipment allocation" and I want to add a calculated column to this report that brings in the "Series" of the equipment from the Initialization process.

I have this query:

(select dbo.ClearWFElemAdv(WFD_AttChoose2)[which is the "Series" column in process (1)] from wfelements where wfd_dtypeid=102[which is the form id of process (1)] and wfd_id=3557)

In my second (2) process I saved the equipment Instance ID from the 1st process in WFD_AttText1.

I want to replace "3557" with the Instance ID from Initialization process which I have in second process (WFD_AttText1) and it is not working.

MVP

Hi,

whenever I have a problem with a calculated column, I activate the diagnostic mode, refresh the report and save the session.
Afterwards I search vor wfelems. This is the query which is executed for the report. Then I would copy the query to management studio and look for the problem.


The potential problem I see in your case is, that you have wfelems and wfelements in your query and therefore WF_AttChoose2 and the like are ambiguous. Add an alias for your table and then reference the columns with the alias.

I see one other issue, at least if this report is not created on the production environment. The dtypeid will be different on each environment. It may be necessary to join the WFDocTypes table, so that you can use the GUID of the form type.


Best regards,
Daniel