This discussion is archived
3 Replies Latest reply: Apr 23, 2013 12:41 PM by JasonBaer RSS

Combining items with different fields

996849 Newbie
Currently Being Moderated
I have users that want to built a report that shows all the products in the same table. Problem is certain fields will only be populated for certain products.

For example, a table with 15 fields, first 5 are constant across both products, 2nd 5 only for product A, 3rd 5 only for product B.

When you select product A from a drop down they want the table to only show the first 10 fields, when you select product B they want the table to only show the first and last 5. If no product is selected all fields should show.

Am I right in thinking this could be achieved with the union to combine results?

Thanks
  • 1. Re: Combining items with different fields
    DNK Explorer
    Currently Being Moderated
    It seems like data level security

    Put Group permissions by setting Content Filters!!

    Combined results is different and it will be used if you have different data sets(SA) and wanted to see both information in single report!!

    Thanks
    NK
  • 2. Re: Combining items with different fields
    996849 Newbie
    Currently Being Moderated
    I do want to be able to see all the information in the same report, but if one of the products is selected it just shows the fields that should be populated for that product.

    Thanks
  • 3. Re: Combining items with different fields
    JasonBaer Journeyer
    Currently Being Moderated
    Assuming that you have the same total number of columns for each product (in your example product A and B both have 10) then yes, you could use a UNION. The first part of the UNION would include the 5 common fields and the additional 5 that pertain to product A. The second part would have the common ones and also those that belong to B. You could include an extra column into which you'd store a string, either 'productA' or 'productB'. Then could then filter on this extra column to show the product you're interested in.

    But if the number of columns isn't the same for both products that won't work. You could pull all the columns into the analysis and then create a separate table view for each product. You could exclude out whatever columns that don't make sense and then use a view selector to move between the different tables.

    I guess it depends upon how you want to display the data. How many different products are there?

    JB

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points