COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Karti on 11 Dec 2014 08:03:31 AM

Title: Conditional Variable - Loop through Data Item
Post by: Karti on 11 Dec 2014 08:03:31 AM
Hello everyone,

I have 2 variables set up (1 string, 1 boolean) where the string variable starts out by seeing if the current report (using ReportName()) is located in the database (using a Data Item). If that report shows up, it then looks at the Package associated with it and compares it to the package for the report being run. It then assigns a value based on that. If the report does not show up in the Data Item, it then just checks the package and goes from there. The second variable is a smaller version of this that just looks at if the report is being e-mailed, and then looks at the ReportName or Package and goes from there.
           
What i am finding is that when I have "ReportName() in ([ReportName])", it only looks at the first [ReportName] that comes up, and ignores all of the rest. This can be changed based on sort order, but I have not been successful in getting it to look at more than one Report Name. When the query is ran in tabular mode, I get all of the data that should be looked through. From what I've seen, the Report Function ReportName() is only available through either Variables or Layout Calculations.

I have already logged a PMR with IBM, but they seem to be slow at responding so I decided to ask you guys for assistance. Attached is the case statement I mention above; You can ignore most of it as it is the first line where I am having issues. If you need any more info on this, let me know!

Thanks in advance :)
Title: Re: Conditional Variable - Loop through Data Item
Post by: Karti on 16 Dec 2014 08:58:24 AM
Has anyone run into an issue like this that can help me out?
Title: Re: Conditional Variable - Loop through Data Item
Post by: BigChris on 16 Dec 2014 09:23:39 AM
I haven't come across this, but could you try reversing the logic to something like:

[ReportName] contains ReportName()
Title: Re: Conditional Variable - Loop through Data Item
Post by: Karti on 16 Dec 2014 09:52:45 AM
Hello BigChris,
Thanks for your reply! I just tried the logic you posted and I still got the same results :(