Forum Discussion

MrDannyHarry's avatar
MrDannyHarry
Regular Visitor
6 years ago

Postgres Folding issue

Hi All,

 

I am connecting to a Postgres Database using Direct Query.

 

When ever I try to do a visual on a calculated field or measure I get the following error:

We couldn't fold the expression to the data source. Please try a simpler expression.

 

I can do it on a non calculated field but not on calculated.

 

My measure has the following code in it.

(This converts seconds  to show 00 hours 00 minutes 00 seconds)

TotalTalk Time = var total = sum(mb_callstats[call_servicing_sec]) var hours = int(total/3600) var minutes = int(mod(total, 3600)/60) var seconds = mod(mod(total, 3600),60) return hours & " hours " & minutes & " minutes " & seconds & " seconds" 

 

Which pulls from a calculated column with the following code in it:
(This converts time format 00:00:00 to seconds)

call_servicing_sec = SECOND(mb_callstats[call_servicing]) + MINUTE(mb_callstats[call_servicing]) * 60 + HOUR(mb_callstats[call_servicing]) * 3600

 

3 Replies