COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: shubh09 on 22 Jun 2017 09:38:20 AM

Title: report is not showing data by default
Post by: shubh09 on 22 Jun 2017 09:38:20 AM
Hi,

I am facing an issue with my cognos report, my report is not showing data by default. To see the data I need to click on finish button(which is prompt button) at least once.
Can someone know how to resolve this? 
Title: Re: report is not showing data by default
Post by: New_Guy on 22 Jun 2017 09:56:50 AM
Hi,
Do you have a prompt page?
Do you have filters for the report query?
Do you have any render variables based on the prompts to render the report page?
Do you have prompts on the report page itself?

If you don't mind please answer the above questions.
Good luck
New guy
Title: Re: report is not showing data by default
Post by: shubh09 on 23 Jun 2017 02:58:21 AM
Hi, Thank you for your response!!
Do you have a prompt page? ---> No
Do you have filters for the report query? --> Yes
Do you have any render variables based on the prompts to render the report page? ---> Yes
Do you have prompts on the report page itself? --> No
Title: Re: report is not showing data by default
Post by: MFGF on 23 Jun 2017 04:15:30 AM
Quote from: shubh09 on 23 Jun 2017 02:58:21 AM
Hi, Thank you for your response!!
Do you have a prompt page? ---> No
Do you have filters for the report query? --> Yes
Do you have any render variables based on the prompts to render the report page? ---> Yes
Do you have prompts on the report page itself? --> No

What expression(s) is/are being used in your filter(s)? DO you have any that are referencing parameters (ie you see ?Something? in the expression)?

If so, this or these will cause prompts to be automatically generated at runtime on a generated prompt page. I'm guessing this is what you are seeing? This is all just guesswork, though. Can you tell us more?

MF.
Title: Re: report is not showing data by default
Post by: shubh09 on 23 Jun 2017 05:46:51 AM
Yes, I have filter something like detailed below:
1) One Date prompt/filter which is associated with update/finish(Prompt button).
2) After that we have 4 filters Region, Location, Week and date, all this are associated with another update button. Also here we have applied render variable properties.
3) We have cross tab report where we are seeing Region, Location, Week, date along with respective hrs details.

in point 1) and 2) we have default values selected but when we execute report by default it will not show any data. If we click on any of update button it will display the data in report(display Region, location, week, date along with respective hrs).   
Title: Re: report is not showing data by default
Post by: Lynn on 23 Jun 2017 06:20:40 AM
Quote from: shubh09 on 23 Jun 2017 05:46:51 AM
Yes, I have filter something like detailed below:
1) One Date prompt/filter which is associated with update/finish(Prompt button).
2) After that we have 4 filters Region, Location, Week and date, all this are associated with another update button. Also here we have applied render variable properties.
3) We have cross tab report where we are seeing Region, Location, Week, date along with respective hrs details.

in point 1) and 2) we have default values selected but when we execute report by default it will not show any data. If we click on any of update button it will display the data in report(display Region, location, week, date along with respective hrs).   

You haven't answered this question:

Quote from: MFGF on 23 Jun 2017 04:15:30 AM
What expression(s) is/are being used in your filter(s)? DO you have any that are referencing parameters (ie you see ?Something? in the expression)?
...
You've said you don't have a prompt page and you've also said that you don't have prompt controls on the report page, so how are you specifying default values for prompt choices? The only other way I know of to do that in the absence of prompt controls is with a prompt macro. Are you using prompt macros?

You've also mentioned buttons which are typically used in conjunction with prompt controls, so I'm confused as to what you've got and haven't got since your responses seem to be conflicting. Or I'm simply not understanding properly.
Title: Re: report is not showing data by default
Post by: shubh09 on 25 Jun 2017 09:30:40 AM
Hi,

Sorry, I have prompt controls in form of filter on the report page itself. To be specific I don't have separate prompt page in my report.
Title: Re: report is not showing data by default
Post by: MFGF on 26 Jun 2017 03:25:57 AM
Hi,

You told us:

Quote from: shubh09 on 23 Jun 2017 02:58:21 AM
Do you have prompts on the report page itself? --> No

Quote from: shubh09 on 25 Jun 2017 09:30:40 AM
Sorry, I have prompt controls in form of filter on the report page itself. To be specific I don't have separate prompt page in my report.

Those two answers directly contradict each other? Can you advise which is the correct answer?

I'm assuming the latter. In that case, you need to define a default selection for each prompt on your report page. You do this using the Default Selections property of each prompt. The reason you are seeing an automatically generated prompt page (which was your original description) is that the report page cannot render without the prompt values being fulfilled, but you have put your prompts on the report page. Therefore the report has to auto-generate a prompt page to fulfil the prompts before the page can be rendered for the first time. To fix the issue, all you need to do is to define default selections for the prompts, which can then be used to render the report page initially.

Cheers!

MF.
Title: Re: report is not showing data by default
Post by: shubh09 on 27 Jun 2017 12:37:18 AM
Thanks for reply, but I already have default selection defined in each filter.
Title: Re: report is not showing data by default
Post by: MFGF on 27 Jun 2017 01:57:13 AM
Quote from: shubh09 on 27 Jun 2017 12:37:18 AM
Thanks for reply, but I already have default selection defined in each filter.

Hi,

Filters can't have default selections - they are defined in the properties of a prompt. Have you checked to see if you have any filters with parameters for which you don't have a prompt defined?

You also indicated you have render variables based on the prompt(s) to render the report page. Can you provide details of how this works?

MF.
Title: Re: report is not showing data by default
Post by: shubh09 on 27 Jun 2017 06:09:30 AM
Hi, We found the root cause of this issue, it is because of setting current week as default week in "week" value prompt.
Where the week value which is stored in DB table is not matching with passed default selection value in value prompt.

Now, can you help me how I can set current week as default???


Currently we have:

1) Week value prompt default value -> "Week", where Week we have as dataitem in our query and the value of it is
Week = 'WK' || cast(_week_of_year('PDATE'), varchar(50)) || '-' || cast(extract(year,current_date), varchar(50))

2) because of this on report it is showing the current week value in report but not refreshing the report with that value by default.
Title: Re: report is not showing data by default
Post by: New_Guy on 27 Jun 2017 09:28:59 AM
Hi,
Create a value prompt with Display value as 'Current Week' and use value as [data item] which you have to create. Post a screen shot of a param value of your week parameter and we can try creating it by using current date and deriving the week.
Good luck
New guy
Title: Re: report is not showing data by default
Post by: shubh09 on 28 Jun 2017 05:26:54 AM
Thank you for your support!!
I have created vale prompt for current week as instructed and my parameter name is Week.
Week has value in DB
For example: WK26-2017 for Current Week.
Title: Re: report is not showing data by default
Post by: New_Guy on 28 Jun 2017 09:00:36 AM
Hi,
set the default value for the week prompt 'Current Week' and use value as 'current week'. set the filter as

week column = case when weekparam = 'current week' then ('WK' || cast(_week_of_year('PDATE'), varchar(50)) || '-' || cast(extract(year,current_date), varchar(50)))) else (?weekparam?) end

The other way is to create a data item in the main query as (('WK' || cast(_week_of_year('PDATE'), varchar(50)) || '-' || cast(extract(year,current_date), varchar(50))))) and using it as default use value.
Good luck
New guy