Using one query to create multiple lists with different grade level in cognos

Posted on 2012-09-03
Last Modified: 2012-09-04
I am using one query to generate 5 lists within a table cells using grade level as the filters.  My question is how to I make it work.  My query has 4 columns.  Year, Grade, Course, and Credit.  I nee to filter on grade to create each seperate list.
Question by:kwcowboy195612
    LVL 35

    Expert Comment

    You will need to explain this a WHOLE lot clearer to get the right help. Give us examples of the data in your table(s), and examples of what you expect to receive as output. Also, I don't get what you mean by 1 query giving you 5 lists? As I said, you need to provide more information. What you have stated is too vague.

    Author Comment

    Data in the query below:
    2009 English1 09 0.5
    2009 English2 09 0.5
    2010 Math 10 0.5
    2010 History 10 0.5
    2011 PE 11 0.5
    2011 Math 11 0.5
    2011 English2 11 0.5
    2011 Reading 11 0.5

    Lists are suppose to look like this:

    Year   Course   Grade  Credit    Year  Course  Grade   Credit      Year  Course   Grade  Credit
    2009   English1   09         0.5       2010  Math       10           0.5          2011 Math          11          0.5
    2009   English2   09         0.5       2010  History    10           0.5          2011 English2    11         0.5
                                                                                                                          2011 Reading    11          0.5

    Since you have one query and if you use the query for these three lists, it would display all the value without a filter.  So how do you make the lists about show using the data in the only query.
    LVL 8

    Accepted Solution

    Best way is to create 5 queries and filter each for each grade.
    That'll be cleaner and efficient.

    If you insist on creating 5 lists with one query, it can be done but may be slower.
    You have to use calculated item for each list without hardcoding filter in the query.
    For example:
    If ([Grade] = '09') then ([Year]) else (null) for grade 09 list.
    If ([Grade] = '10') then ([Year]) else (null) for grade 10 list and so on...

    Author Comment

    I had five queries and I was told to combine them but I have another issue and I will enter another ticket.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Title # Comments Views Activity
    VB RDLC Report 1 54
    seriesUp challenge 7 79
    changeXy challenge 13 40
    delphi parse string to params 3 41
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now