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

 

How to Hide/Show report columns based on conditions without using Prompt in RS

Started by Annon, 04 Apr 2015 10:54:44 PM

Previous topic - Next topic

Annon

Hi,
I have to show data for 4 previous Quarters in report output. If today is 4th April, the report output should show [Cur Year Q1],[Prev Year Q4],[Prev Year Q3],[Prev Year Q2] in report outputs in this order. If today is 1st of July the report output should automatically show [Cur Year Q2],[Cur Year Q1],[Prev Year Q4],[Prev Year Q3]. I am not supposed to use any prompts. Please suggest me how to Show/Hide columns as per conditions. I want to use -case when([Cur Mon] in (1,2,3)) then ([PYQ4],PYQ3],[PYQ2],[PYQ1])
when ([Cur Mon] in (4,5,6)) then ([CYQ1],[PYQ4],[PYQ3],[PYQ2])
when ([Cur Mon] in (7,8,9)) then ([CYQ2],[CYQ1],[PYQ4],[PYQ3])
when ([Cur Mon] in (10,11,12)) then ([CYQ3],[CYQ2],[CYQ1],[PYQ4])
end  But somehow this case statement is giving error. If i try to use all report columns in order [CQY3],[CYQ2],[CYQ1],[PYQ4],[PYQ3],[PYQ2],[PYQ1] in my list report and try to Hide/Show then i do not know exactly how to Hide and Show these 7 report columns based on my condition. PLEASE HELP.   











navissar

You neglected to specify whether you're using a relational or dimensional model. Answers vary widely between the two.

Annon

My mistake Nimrod. It is relational model(package) and it does not have quarterly data items. I have logic how to calculate it. But do not know how to put it in Cognos. It would be a great help if i can get some help.

navissar

Instead of a parameter value use the function extract(month,current_date) to get the current month. To get the current quarter, round up the outcome of extract(month, current_date)/3. rest of it should be easy and follows the same rules.
You can also look at the logic here : https://www.linkedin.com/pulse/20140515203011-84415552-cognos-tip-filter-months-by-half-year-quarter-easily-on-non-dwh-environments?trk=mp-reader-card to get some ideas of how the logic could be built.