COGNOS 11 - Manual Input Column for Query Calculation - cognos

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.

Related

Fetch value based on Filter values

I am working on an Excel file where This is my First Table.
Now I have another table that has exactly the same Column names
Now What I wanted is When the Value of Table1[Status] is Active or Pending it should fetch all the values in Table 2. and Don't do anything when the Status value is Pending or Empty
The Expected Output
I have tried the following query but I think I am doing it wrong.
=XLOOKUP([#GID];Table1[GID];SWITCH([#[Status]];"Active";Table1[Status];"Pending"))
Does anyone know how to solve this challenge?
Solution 1
A formula based solution cannot display the output in a Table.
Suppose your first table is called Tbl_Source, enter the following formula (in Excel 365) in a single cell and you will get the desired output:
=FILTER(Tbl_Source,(Tbl_Source[Status]="Active")+(Tbl_Source[Status]="Pending"))
Solution 2
If you want to show the filtered output in a new Table, you can try using the Power Query function which is built into Excel 2013 and all later versions.
Firstly, highlight any cell within the first table, then load the table to the Power Query editor:
Secondly, click the filter button on top of the Status column, and select the desired criteria as you would normally do in Excel:
Lastly, Close and load the output table. By default, Excel will load the output to a new table on a new worksheet. You can cut and paste the output table to the desired worksheet, or Google how to load the output to a query and then choose where exactly to load the output to.
If you want to add additional data or make changes to the first table, you need to right-click any cell within the output table and choose Refresh, then the output table will be updated with additional data.
Let me know if you have any questions.
First
Then (Choose Table)
EVALUATE
CALCULATETABLE(
Table1,
Table1[Status] ="Active" || Table1[Status] = "Pending"
)

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.

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

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!

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.

get the average of two columns in views using lotus notes formula

How to get the average of two columns in views using lotus notes formula
Create a new column in your view to display the average. You'll add a formula to this column to calculate the average.
If the two columns you wish to average are simply based on items in your documents, then add this formula:
(Column1 + Column2) / 2
If your columns are more complex, for example they contain calculations themselves, then you'll want to refer to the column using its programmatic value. On each column, right-click on the column and then click "Column Properties". Select the last tab and set the Programmatic name to some text, for instance Calc1 and Calc2. Then use this formula in your third column:
(Calc1 + Calc2) / 2
If you want to display the average of 2 columns then Bluefoot's comment referring to another question is what you require. However, if you also want to display the result in a subsequent third column, then you have a bit more of a problem.
You will need to write a scheduled agent that takes the average but then writes the result into a field on to the document, and then use that field as the value to be displayed in the 3rd column. I say a scheduled agent as you could have this run hourly or daily as required to update values. If a user changes the values that would cause a re-calc. You can clear the new field pending update of by the scheduled agent. There are still other ways to do this, depends on requirements.

Resources