Using NullIF and Coalesc in SQL vs Calculated Column w Case Logic in BI Tool (Tibco Spotfire Analyst)

34 Views Asked by At

In our BI tool (Tibco Spotfire Analyst) we further create columns by adding Calculated Columns that typically have case logic expression to calculate desired output based on dataset queried from SQL.

The overall problem I am trying to solve is performance - long loading times when Tibco does a on demand query.

While this works, when we are loading significant amounts of data into the BI tool this slows down performance with numerous calculated columns.

I feel like we could more efficiently do the same calculations within the SQL in the Information Link in Tibco using some combination of NULLIF and COALESC.

Here is sample data, and a typical Case logic we use:

Sample data

Here is the desired output of above Case logic:

Desired output for sample data

I haven't yet successfully figured out how to incorporate this same desired output into the SQL within the linked Information Link in Tibco report. It seems like a combo of NULLIF and COALESC could work.

Any suggestions?

SELECT

(NULLIF(COALESCE(finalscore,
initialscore), 0.00)) AS [Scores]

FROM scorecte

0

There are 0 best solutions below