Home  >  Blog  >   IBM Cognos

Conditional Formatting in Cognos Report Studio

Rating: 5
  
 
14847

 

Conditional Formatting

  • Conditional Formatting is a process of formatting the business data based on a given condition.
  • Users can quickly analyze the business data by using conditional formatting

  • Conditional formatting can be done with the help of variables

  • There are three types of variables – STRING, BOOLEAN, REPORT LANGUAGE VARIABLES

  • Variables are used to hold the results of an expression

 

Learn how to use Cognos, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Enroll in Free Cognos Training Demo!

Conditional formatting – String variables

  • Create a list report with the following query items

  • Order year, Order method, Quantity

  • Group on order year

  • Total on quantity

  • Go to conditional explorer-  Click on variables

  • From the insertable objects, pane drag the string variable and drop it on variable window

  • Define the following expression in the expression definition window

  • if ([Query1].[order year]=2004) then (1)

  • else if ([Query1].[order year]=2005) then (2)

  • else if([Query1].[order year]=2006) then (3)

  • Click on validate- click on OK

  • Add variables 1,2,3 to the values list

  • Click on add –  give values               

          1
          2
          3

  • Click on OK

  • From page explorer,

  • Open the report page page1

  • Select order year data item

  • From the ancestor, properties click on list columns body style

  • From conditional explorer,

  • Select the string variable 1

  • From the properties pane, select style variable

  • Click on eclipses { … }

  • Set the variable as string1

  • Select the string variable1

  • Select the font property-  click on eclipses

  • Set the font size and color

  • From condition explorer

  • Select the string variable 2

  • Set the font size and color

  • From condition explorer,

  • Select the string variable 3

  • Set the font size and color

  • Turn off the explorer bar (By double-clicking) and run the report

 MindMajix YouTube Channel

CONDITIONAL FORMATTING – STRING VARIABLES

conditional formatting
conditional formatting
conditional formatting cognos
conditional formatting 1
conditional formatting 2
conditional formatting cognos
conditional formatting 4
conditional formatting 5
conditional formatting 6
conditional formatting 7
conditional formatting 8
conditional formatting 9
conditional formatting 10
conditional formatting 11
conditional formatting 12

Conditional formatting – Boolean variables

  • Create a list report with the following items

  • The product line, Product type, Product name, Margin

  • From conditional explorer click on variables

  • From insertable objects

  • Drag the Boolean variable and drop it on the variable window

  • Define the following expression in the expression definition window

  • Drag the margin from available components and drop in the expression window

  • [Query1].[Margin]>0.3

  • Validate – à  OK

  • From page explorer – à Select page1

  • Select any data item in the report

  • From ancestor select list column body style

  • From properties pane

  • Select style variable property

  • Click on eclipses

  • From drop-down list box

  • Select the Boolean1 variable- à Click on OK

  • From conditional explorer

  • Select Boolean variable – Yes

  • From the properties

  • Set the font property—>Click on eclipses

  • Set the font size and color

  • From condition explorer

  • Select the Boolean variable as No

  • From the properties pane—>Select font properties

  • Set the properties—> Turn off the explorer bar

  • Save & Run the report

[Related Article: Cognos Interview Questions And Answers ]

 

CONDITIONAL FORMATTING – BOOLEAN VARIABLE

Create a list report with the following items
conditional formatting for Boolean variable
conditional formatting for Boolean
conditional formatting for Boolean 1
conditional formatting for Boolean 2
conditional formatting for Boolean 3
conditional formatting for Boolean 4
conditional formatting for Boolean 5

Conditional Formatting – Report Language Variable

  • Create a list report with the following query items

  • Order year, Order method, Quantity, Revenue

  • Group on order year

  • Total on quantity and revenue

  • From conditional explorer bar,

  • Click on variables

  • From insertable objects on

  • Drag the report language variable and drop it on the variables window

  • Select Chinese language from the list of languages

  • Click on OK

  • From page explorer,

  • Click on Page1

  • Select any data item

  • From ancestor

  • Select list

  • From properties pane

  • Select the style variable

  • Click on eclipses

  • Select the style variable on report language1

  • Select Chinese

  • Click on OK

  • From conditional explorer

  • Select the report language variable as Chinese

  • Select the font property

  • Set the font size & color

  • From condition explorer,

  • Select the report language variable as others

  • From properties

  • Select the font

  • Set the font properties & size

  • Turn off the explorer bar

  • Save the report

  • Set run options – Chinese

  • Run the report

CONDITIONAL FORMATTING – REPORT LANGUAGE VARIABLE

report language variable

report language variable 1
report language variable 2

report language variable 3
report language variable 4
report language variable 5
report language variable 6
report language variable 7
report language variable 8
report language variable 9
report language variable 10
report language variable 11

Explore Cognos Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

 

Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
IBM Cognos TrainingApr 27 to May 12View Details
IBM Cognos TrainingApr 30 to May 15View Details
IBM Cognos TrainingMay 04 to May 19View Details
IBM Cognos TrainingMay 07 to May 22View Details
Last updated: 04 Apr 2023
About Author

Ravindra Savaram is a Technical Lead at Mindmajix.com. His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

read more
Recommended Courses

1 / 15