AnsweredAssumed Answered

Why would dataviewer have different results from a calculation?

Question asked by ScotLoomis on Aug 16, 2018
Latest reply on Aug 17, 2018 by ScotLoomis

I have a SQL based calculation that works for the most part, but give incorrect results from time to time.  When I paste the calc into the data viewer, it comes out with the correct answer.  the calc is...

 

Let ( ttl = ExecuteSQL (

"SELECT COUNT (  DISTINCT clientID )

FROM clientAnswersRoot

WHERE root = ?

AND Industry = 'HLTH'" ;

"" ; "" ; report::root

) ;

 

 

Case (

 

 

PatternCount ( report::Question ;"Number of Responses" ) ; ttl ;

ttl=0;0;

Round(ExecuteSQL (

"SELECT COUNT (  DISTINCT clientID )

FROM clientAnswersPerLine

WHERE Q_Num = ?

AND Industry = 'HLTH'" ;

"" ; "" ; report::QNum

) / ttl * 100 ; 1 )

))

 

Outcomes