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 Field Selection for Display on Chart

Started by bobj, 10 Mar 2009 04:39:08 AM

Previous topic - Next topic

bobj

Hi folks,

I have a requirement where I need to enable the users to select key fields to be displayed on a chart.
I can do this on a list report by linking a variable in Conditional Explorer to the render variable properties of the data item.
However, when trying to apply the same technique to a chart the render variable is not available, only the text variable.
By using the text variable on the chart the chart node members can be rendered but this only determines the displaying of labels i.e. labels can be 'switched on or off'.

What I need is rather than the labels being rendered I want the actual data items being rendered as hidden or shown on the chart based upon user selection.

Is this possible in a chart or is this functionality only available on list report columns?

Your help would be appreciated.

Thanks,
Bobj BI.

blom0344

Which dataitems do you want to conditionally render?

Did you try to make a generic dataitem that stores different source values based on a CASE?

bobj

#2
Thanks for the reply.

I want the data items in the series of the chart rendered which are not generic (I have 5 or more seperate data items).
These are counts based upon if statements if([date1] is null) then (1) else (0)
This then plots on the chart as a stacked bar chart. If I make these generic then I don't think it will plot as a bar chart?

Cheers,
Bobj BI.





blom0344

Okay, that makes it clearer. However, I do not yet see where the conditional rendering ( of what?) comes into play

bobj

Basically, on the prompt page I have a check box where the users can select/choose which data items they want to plot on the chart.
What do I need to do from the chart to get the selected columns to plot?

Hope that makes sense.

Ta,
Bobj BI.

Gollapudi

#5
Hi,

I think you dont have to go for conditional formating for this, can have a custom statement inside your data item, I have created a sample report, just have look at the attached report.

Thanks,
Gollapudi.

nivas_palle

Hi Bobj,

Wat gollapudi said make sence.. i tried and its working.
tell me.. it matches ur requirement or not.


bobj

#7
Hi,

I am unable to open the report from Report Studio.
"The report version "http://developer.cognos.com/schemas/report/5.0/" is not supported.

I am using 8.1

Also, just to let you know that I have tried using a case statement but only allows one selection not multiple due to the '=' expression.
Have tried 'in' for multiple selections but to no avail.
I am using a stacked bar chart.

Thanks,
Bobj BI.

abu_a

Hi Bobj

Why don't you create a separate value prompt in your prompt page, therefore all 5 data items will have 5 different associated parameter names from each other.

Hope this helps
Abu

bobj

I could do that abu_a but I've got 13 user selections and the design of the prompt page will look messy and would entail creating 13 seperate prompts for each selection.
I think the way forward is a custom statement if I can get it to return multiple selections on the chart.

Thanks,
Bobj BI.

Gollapudi

Hi bobj,

Sadly our Cognos 8 server is not working today, so thats why i have created that report in our 8.4 Server, any ways let me explain you what I have done.

1. I have created a report with a Chart.
2. I had a single Query in that I have 1 measure [Quantity] and 4 dimentions [Time, Product, Order, Geography]
3. Added Quantity at measure and Time at Category.
4. Now wants to Add a dimention on Series as per users requirement.
5. For this I have created a Data Item with the below calculation.

Case
When ?Dim?='Product' then([Product line])
When ?Dim?='Order' then([Order method])
When ?Dim?='Terr' then([Sales territory])
end

6. I have created a value prompt with the same parameter (?Dim?)
7. Added Static chioices as follows.......

Use                Display
***********************
Product         Product Line
Order            Order method
Terr               Sales Territory

8. now run your report and see....

Thanks,
Gollapudi.

bobj

Thanks for the reply.

I can get the chart to return data with an if statement but not the case statement (used same structure as you provided).
But with the if statement (aswell as the case statement I feel) this returns only one selection, I want multiple selections to plot on the chart.
When using the '=' operator this will return 1 selection which is not what I need.

abu_a

Hi Bobj

I had a friend who had the same problem and we were able to resolve it by creating separate value prompts in the prompt page for each data item. While it isn't the most efficient way of solving said problem, it will solve it nonetheless.

Cheers
Abu

Gollapudi

Bobj,

You can display multiple selections also not an issue, but you want them to display in a chart right so can you provide me an image like where do  you want to place them and all, then only I can plan accordingly.

Thanks,
Gollapudi.

bobj

#14
Attached is a word doc with the stored images.
The prompt only allows me one selection even though I select Multi-Select from the properties and also appears as Radio Button in Cognos Viewer even when I select Check Box Group from RS. Do not know why!!  ???

Hope this helps.

Thanks,
Bobj BI.

bobj

Quote from: abu_a on 11 Mar 2009 06:52:46 AM
Hi Bobj

I had a friend who had the same problem and we were able to resolve it by creating separate value prompts in the prompt page for each data item. While it isn't the most efficient way of solving said problem, it will solve it nonetheless.

Cheers
Abu

I tried that as an alternative but receive the same problem i.e. 1 selection plotting only rather than multiple.

bobj

Is there anyone else who can help me on this?

Thanks,
Bobj BI.

Gollapudi

Hi Bobj,

I didnt get the requirement properly, you saying that you wanna select Multiple values and the word doc which u sent is showing some radio button [using "=" in expression], so can you please tell me what exactly your looking for..

Thanks,
Gollapudi.

bobj

Hi,

Okay, I have a prompt (?fieldselect?) which should enable the user to select which fields they want to plot on the stacked bar chart:

Start Date Count
Committed Date Count
Target Date Count
End Date Count

I have a data item consisting of an 'if statement' in the series which reads as follows:

if (?fieldselect? = 'Start Date') then ([Start Date Count])
else if (?fieldselect? = 'Committed Date') then ([Committed Date Count]) etc.

The above data item should allow multiple fields to plot on the chart, but at the moment I can only get one field to plot at a time and not multiple.

How do I get the multiple fields plotting on the chart?

Hope that explains my problem.

Thanks,
Bobj BI.

LFedel

Dynamic Field Selection.
I created a report that allows the users to dynamically select rows, columns, and intersection for a crosstab.  They can only select what I build in my Value Prompts.


This example explains how I build the rows:

Create a Value Prompt.
Enter static Choices
For the ‘Use’ values enter your column fully qualified name:

Use
[package_namespace].[Column_name]


Display something user friendly:
‘Column name’

So for mine
Use
[ZZZ Presentation Layer].[ZZZ Credits Financial Class].[FINANCIAL CLASS GROUPING]
Display:
Financial Class Group


Now I created a report field called Rows:
#prompt('Param_Row','token')#

When the report run row is set to whatever element they selected.  Works Great.


--Lou

bobj

I have managed to find a solution to this at last  :P

The prompt only works on Dimensional data elements and not relational.
The following expression will be required which is based upon the Go Sales data:

set(#promptmany('PromptName','token','[Sales].[Sales].[Margin]')#)

Bobjs apprenctice

Bobj you are a true legend and I stand tall and salute you!!!!

Many thanks for posting this information as it has helped me to understand why I was having a similar problem.

Maybe we can meet up and discuss old times over a twix or two.

Long live Bobj the home of Cognos Knowledge!!! ;D

bobj

Hey Wannabe Bobj,  ;)

I give you permission to stop saluting me now.
You'll find that forums are for people who have similar Cognos issues and are looking for a solution.

I'll take you up on the twix offer though after you have eaten your weetabix.

Feel free to ask any questions and one day you too may become a legend.

PS - Bobj is short for Business Objects... ;D

Bobjs apprenctice