Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Function editor for SQL Calc fields

edited December 2014 in General
I was sure that I requested this years ago but I can't find any trace of
it, so I'm doing it now in case there is no change in v16.

The ability to write your own SQL in the Query Designers "Function"
column (Calcs tab) is very very useful But the single line editor is
very very unwieldy. Here is an example of a typical bit of code we have
in some reports (note the use of stored procedures that do the work RB
can't):

CASE WHEN SORT.RecType IN (1,2,3,4,5,6) THEN CASE WHEN Eqlists.PriceMode
= 0 THEN CASE WHEN SORT.ChargeQuantity > 0 THEN SORT.Price /
SORT.ChargeQuantity ELSE 0 END ELSE 0 END WHEN SORT.RecType IN (7,9)
THEN GetIncomeProportionForPricedAlliasPart(Sort.LineRef, Sort.xGUID, 0)
WHEN SORT.RecType IN (11) THEN
GetIncomeProportionForComponent(Sort.LineRef, SORT.LineCODE, 0) ELSE 0 END

Putting that on one line is horrible. To edit I have to copy to an SQL
beautifier so that I can read it easily and get all the CASE "ends" in
the right place; then I have to remove all the line breaks and paste it
back. End users have no chance :)


Would be great if as well as the drop down button there was another one
besides that allowed you to popup a memo editor; moreover, have the code
saved as it was laid out.

Thanks.

Comments

This discussion has been closed.