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

How can i add filter to only 1 column on a report?

Started by mlov83, 02 Sep 2008 09:07:52 AM

Previous topic - Next topic

mlov83

Hello everyone I apologize if this sounds like a stupid question however I'm a noob to cognos. but what im trying to accomplish with cognos would seem to me very doable. I Have a report that runs base on a calculation filter using the datediff function. It basically calculates the Difference of two dates and it the date diff is above 30 days it shows the result otherwise it does not.
My Problem is that i dont want to add another list i would just like to add a column to my report that say 31-50 days and show the amounts on that column. The problem that im having is that when i put a filter of 30 days and on the same list a filter of 50 days i get nothing. I assume it problablys has to do with the fact that you can only have 1 filter to a list? and maybe it cannot meet both datediff categorys?... Im totally confused on this one. I have been able to do it but have had to add another list to my report and it just looks sloppy in my opinion.
Is there anyway not to show the report headers  when it runs?
Thank you eveyrone for the help in advance.

mlov83


Jeka

You can create 2 queries, and each query will pull the data you need, for every query you will set up a filter and then UNION those queries into one....


mlov83

Thanks for replying to my post however that brings up 2 more problems for me. 1)How if i have 2 queries and im going to use a  union how do I not show the first two querys and 2) now that i have the data on the amount column  how can i make it so that i have 3 columns each with their corresponding amounts. i.e again the frustuatio with the filter on just 1 column...
1)column 1-30
2)column 31-50
I mean i figuered out that
(_days_between(current_date,[Invoice Payable].[Invoice].[INVOICE_DATE])) between 0 and 30
Sorry if this is a stupid question but is one that i havent been able to figuere out.

mlov83

I finally Figuered this one out!!! BOY im i excited  ;D here is what i had to do.
I created a union like nichole suggested however then i added some data items in addition to a little case statement

CASE
WHEN  (_days_between({sysdate},[INVOICE_DATE])) between 0 and 30
Then ([Union2].[APPROVED_AMOUNT])
ELSE (NULL)
END

Hope this helps someone else down the line.

blom0344

I´d say, use the union (like Nicole suggests) or solve this with a case, but mixing the 2 seems superfluous..

mlov83

hey blom you are rigth I might not needed the UNION however i didnt know any better and it seem like the right thing to do. I appreciate the tip on the case statement! I saw you help me on tektips as well.
Thanks a bundle! ;)

blom0344

There is no technical reason to shy away from a union , but it is not going to improve performance nor does it adhere to Occam's razor    ;D

All other things being equal, the simplest solution is the best