If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Dynamic number of columns in report

Started by hana00, 20 Sep 2017 04:39:47 AM

Previous topic - Next topic

hana00

Hello All !

I have some problem with report in Cognos, I have googled it many times but unfortunatelly didn't find any sastisfying information  :(.

I would like to present table with dynamic number of coulms.
Data for dynamic columns are in the database by key - value, number of attributes can be different and also attributes can be various for objects (really important thing is that attributes can have numeric data types but also non-numeric, such as Varchar ), and they can look just like that

Parameter   Name of object   Attribute Name    Value

Parameter 1   Object 1   Attribute 1              Value 1
Parameter 1   Object 1   Attribute 2              Value 2
Parameter 1   Object 1   Attribute 3            Value 3
Parameter 1   Object 1   Attribute 4              Value 4
Parameter 1   Object 2   Attribute 1            Value 1
Parameter 1   Object 2   Attribute 2               Value 2
Parameter 1   Object 2   Attribute 3               Value 3
Parameter 1   Object 2   Attribute 4               Value 4
Parameter 1   Object 5   Attribute 6               Value 6
Parameter 2   Object 5   Attribute 7               Value 7
Parameter 2   Object 6    Attribute 6               Value 6
Parameter 2   Object 6   Attribute 7                Value 7


On Cognos we would like to present the data in that way:

SECTION BY: Parameter 1

Object Name     Attribute 1      Attribute 2       Attribute 3          Attribute 4
Object 1                Value 1        Value 2        Value 3               Value 4
Object 2                Value 1         Value 2        Value 3               Value 4



SECTION BY: Parameter 2

Object Name   Attribute 6    Attribute 7
Object 5            Value 6           Value 7
Object 6            Value 6           Value 7

Any idea how to do that??  :)



BigChris

i might be missing something, but how are you constructing your database table so that it'll store multiple datatypes in the same Value field? Or are Value1, Value2 etc. separate fields?

hana00

They are stored row by row, new attribute is new row in database. 

BigChris

Yep, I think I get that...it's the Value bit that I'm just not getting. What database are you using as your back end? It might be that I'm used to SQL server and you're using something different (are you?). The way you've laid it out, makes it look like there's a row for each Parameter / Object / Attribute combination, with a column (field) for Value. But then you say that that field (Value) can hold multiple data types. SO...the table would look something like:


ParameterObjectAttributeValue
P1O1A1"Elephant"
P1O1A22017-09-20
P1O1A342

Or have I completely misunderstood?

Invisi

Typically that column would be a string (varchar)? With all related issues?
Few can be done on Cognos | RTFM for those who ask basic questions...