COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: darners on 10 Feb 2014 04:24:29 AM

Title: Sub Report
Post by: darners on 10 Feb 2014 04:24:29 AM
Hello everyone

First post on this forum and hope someone can help with a query I have

I have a requirement to filter on previous working day, I have created a query using running difference to give me the previous working day from our calendar table.

I want to use this to join to an existing query to give me the previous working date for each line

However when I try to join it is doing the running differnece calculation again

I have tried using 'Use Local Cache' but to no avail

Any help greatly appreciated

Title: Re: Sub Report
Post by: anjidwh.cognos on 11 Feb 2014 03:24:54 AM
Hi Darren,

You can add a filter in existing QS say "datecolumn = _add_days(current_date, -1).

I hope it will help you!

Thanks
SRK
Title: Re: Sub Report
Post by: darners on 11 Feb 2014 09:14:59 AM
Hi , thanks for the reply, but that wont work for working days

I have two queries.

1. Brings back all transactions for particular filter (this includes a transaction date)

2. Second query to calculate previous working day from a table

When I try to join them it is doing the calcualtion for previous working day again

My question is, how can I run the second query, then cache those results to be used to join to the first query, to give me previous working day for each transaction line

Thanks
Title: Re: Sub Report
Post by: darners on 19 Feb 2014 05:21:08 AM
Any ideas ?
Title: Re: Sub Report
Post by: BigChris on 19 Feb 2014 06:03:27 AM
Both queries will run each time you run the joined query. I think there are ways to cache some query results, but i'd stay away from those if possible...I've never been a fan! Surely the query to get the previous working day should be lightning fast - and arguably you should load that data into the calendar table for each date so that it's a simple read of the table...no calculation required.