• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

SQL Help

cbrunny

Diamond Member
I'm trying to figure out how to do something that is probably relatively easy. I'm not an expert but I'm halfway good with SQL.

In english:

Columns:
Factor 1 (easily defined),
Factor 2 (easily defined),
Factor 3 (easily defined),
Factor 4:
Value A: if the count of Value B (for Factor 4) within Factors 1 and 2 or the count of Value C (for Factor 4) within Factors 1 and 2 is less than 5, Value A = 1
Value B: if Value A = 1, null else 2
Value C: if Value A = 1, null else 3

This calculation would logically loop back on itself which is probably why I can't figure out how to do it. Does anyone have any suggestions? This would be a summary of record (individual people) level data.
 
Hm, you could try finagling a CASE WHEN THEN ELSE END in there, or write functions that accept the values and return what you're looking for, and call the functions in your select statement.
 
Solved. It took a rather long SQL code, but I've got the output coming the way I want it. Now I have to figure out the easiest way to rebuild this in Cognos 10! That'll be fun.
 
Back
Top