Cognos 10: restrict the items displayed in a value prompt based on the criteria in another value prompt - cognos

I'm trying to find a way to restrict the items displayed in a value prompt based on the criteria in another value prompt
I have a report where the row and column values are dynamically selected using radio button value prompt:
Row Values
Nationality***
Domicile***
Fee Status***
Previous Institution
Sponsor
Column Values
Academic Year
Level
Stage
Nationality***
Domicile***
Fee Status***
School
Department
Course
The starred values occur in both lists.
I'd like to be able to hide, for example, 'Nationality' from the Column Values if it has been selected in the Row Values.
Can anyone suggest a way of achieving this?

Set the column value prompt to cascade from the row prompt and set the Auto-Submit property on the row prompt to 'Yes'. Use the following filter in the query feeding the column prompt:
value <> ?rowParam?
...substituting the name of your data item for value and the name of your row parameter for ?rowParam?.
The query feeding the column prompt will output all values except the one selected in the row prompt.

It's not the most elegant solution but I've achived this using render variable. Essentially, I'm displaying a different prompt control based on a variable which looks at the other prompt control.
Would be keen to hear if anyone has neater solution!

Related

COGNOS 11 - Manual Input Column for Query Calculation

I am trying to add a column to a list in COGNOS 11 where one can manually enter data needed for a query calculation.
So the first column would be data pulled from DB based on query/filter, I want to add a column beside that to enter a value. Next, the column to the right would be a query calculation that is performed on the 2 columns.
Sample:
[Column 1][Column 2][Column 3]
[Data pulled from DB] [Manual Input] [Query Calculation]
I have looked through the user guide, but unable to find any indication on how to do this. I have tried implemented text prompt but I get an error as well. Any help is appreciated.
What you are looking for is a parameter. Add a textbox prompt control to the report page, allowing the user to enter a value and then click a Finish button. You can present the value in every row of column 2 using a query expression
?myparam?
or not present the value and simply perform the calculation for column 3.
If I misunderstand and you want the user to enter an arbitrary value on each row, that's Excel, not Cognos.

Assign default value to cell in Excel dropdown and should accept any other value

I am using Excel sheet as test data source for my automation scripts and I want to reduce test data creation time by selecting default values for cell.
Query:
I have column as Company name so by default I want to auto populate value as "XYZ" for all cells which are null.
Tried two options:
Data validation list: I have inserted list with my default value as XYZ however if I want to add some other value I have to go back and edit the list. Want to avoid this manual effort.W ith auto-population it should allow user to enter any value.
Added formula: =IF(A2="","XYZ")
A (Company ID in Excel). It shows an error-Try moving your formula to different cell
Could anyone help me to solve this.

Excel adding data based on current data

I'm trying to write a macro that i can run which will allow me to simply sort a range of orders into what i like to call categories.
The basic idea is that we get orders through, and we generally have to print a different type of shipping label for the different items, based on weight, size and value. Unfortunately, there is no easy way of doing this other than going through all orders (sometimes thousands) and copying them into different worksheets to group them into the type of shipping method we need to use.
What i'd like to do (i already have a couple of macros already) - is to look in another sheet whereby we store the item titles, and have a second column within that sheet with a number (1, 2 or 3). For each item, based on it's weight, size or value, which we have already specified - they would be assigned a number. The Macro will look at the item name, if the sales sheet finds a match from column A in the item's sheet, it will then add the correct number specified in the item's sheet to the cell next to the item title in the sales sheet.
Column A-G has all customer details, Column H has the item title. The number i'm wanting to add to the row will be inserted into Column I.
The item's sheet has Column A which is the item title, and Column B is the number assigned to this item.
I have tried to muster a macro up myself, however it's confusing me no end.
This is exactly what vlookup is used for
=VLOOKUP(H1, items!A:B,2,FALSE)
Put this formula into I1 on the sales sheet and drag it down, if the items sheet is not in the same workbook , you will need to modify the reference to point to it,
you could obviously write a macro that will insert this formula and drop it down, but it will still be using vlookup or application.vlookup to get the result
Wildcard searches at the front would be
=VLOOKUP("*"&H1, items!A:B,2,FALSE)
or both ends would be
=VLOOKUP("*"&H1&"*", items!A:B,2,FALSE)
NB* BE CAREFUL WITH THIS AS YOU MAY HAVE ITEMS WITH SIMILAR DESCRIPTIONS
like "apple" and "red apple"
you should always use a product code to do lookups when available

Grouping by an ID, to find if there are variations in another column

So I have a spreadsheet with products listed. There is a product ID which represents different colors and sizes of the product. There is also a column for price.
I want to ensure that all the products with the same ID have the same price and there is no variation.
How do I group all cells with the same ID, and then run a check to ensure all those IDss have the same value in the price column?
I would prefer not to use VBA, if possible.
Given this example spreadsheet:
Sort by Product ID
Enter this formula into C1: =OR(A2<>A1,B2=B1)
Drag the formula down to C8
All the items with FALSE indicate values where the Product ID matches the Product ID above but the price doesn't match the price above.
The formula returns TRUE if either the Product ID of the current row is different than the Product ID of the row above (which means the prices don't need to match) or the price of the current row is the same as the price of the previous row (if the prices match, it can't be invalid). Otherwise, it returns FALSE.
Depending on the size of your dataset and how often you want to do this, you might manage to do this manually by using Excel's "Filter" capability. This is a basic solution as I am not sure of your needs or experience:
Click anywhere in your dataset
Under the "Data" tab, click Filter. Your column names should have a dropdown button on them.
Click the dropdown button on your ID field, and only select the ID you want to evaluate.
Click the dropdown button on your price field, if there are any different values showing then they are not all the same.

Select neighbouring cells of a cell with a specific value in excel

I have a data set in excel with four columns;
Username, Computer, Department information
I have used a filter to select all unique usernames in the data set, then have used counif() to count how many times the username occurs in the data set - This works fine.
Now I want to search the original data set for every time a specific username appears and when it does, I want to select the 'information' cell to that relevant row. So the output will be an array rather than one value,
example,
Username|Information
A 1
A 2
B 3
A 4
D 5
So if I use my function to search for all values from 'information' with username A, I want this to output,
Information
1
2
4
Thanks.
Here's one method that doesn't involve VBA. It may not be practical for your needs though.
Make a pivot table based on your data
Add Username to the Filter
Add Information as a Row
Change the Filter from (All) to your desired username.
If you need to rerun the underlying dataset, just right click to refresh the pivot table.

Resources