2

Is there a way to round to 2 decimals in a query-of-query on an avg statement? I could not find a system function in the adobe docs.

Joe C
  • 3,506
  • 2
  • 21
  • 32
Marius
  • 3,043
  • 1
  • 15
  • 24

2 Answers2

4

Not in QoQ, no. The full docs for QoQ are here: "Query of Queries user guide". That includes the entirety of QoQ's functionality.

You're just gonna have to do the rounding when you're using the recordset.

It might be worth raising a ticket on the bug tracker to get an enhancement for this: https://bugbase.adobe.com/. It's functionality I've needed in the past.

Adam Cameron
  • 29,677
  • 4
  • 37
  • 78
  • Thanks, will open a feature request for it, seems like a logical addition for future versions. – Marius Jan 31 '14 at 13:19
1

I needed to do a similar thing to use the QoQ result in a chart. I ended up using the QuerySetCell to format the QoQ column.

In the example code below, qryResult was my QoQ query name and MWDPCT was the column that I wanted to reformat.

<cfloop query="qryResult">
  <cfset temp = QuerySetCell(qryResult,"MWDPCT", decimalFormat(qryResult.MWDPCT),currentrow)>
</cfloop>

Hope that helps a bit.

Carlos M
  • 11
  • 1