OBIEE Characteristic Table with dynamic header - pivot-table

I have original data as shown above with a single record. I have name of the field in one column and value in another column. I need to transform make the heading dynamic as shown below.
I tried with table pivot table and trellis, not no success.

You should be able to do this in a pivot table in OBIEE.
Please see my below screenshot. I was able to get my column originally named 'Total Contracted Cases' to now be called 'USD' because that is the value in the column 'Currency Code'. So for you, you should be able to get the column 'PARAM_VAL1' to be called 'COUNTRY' because that is the value in the column 'PARAM_CD1'. See below for my example:
In the second image, be sure to click on the 'Measure Lables' properties to hide the value.
For columns that are not metrics (no aggregation rule set) that will be used in the 'Measures' section of the pivot table, you will have to define an aggregation rule in the column properties dialog box to keep the value from being converted to null. If your data is as you say it is (a single record), then this should not be an issue; you should be able to pick any aggregation rule and not have to worry about dropping data.

Related

Problem with Showing Query Results on a Form

I'm having a Projects lists Continuous form where the form's Record Source is based upon a table.
I have a requirement to display a field from another table which is linked back to original table using its primary key. The primary key is a AutoNumber field, but when displaying in the form I've used Input mask something like this "TMG/FEA/"0000.
So I made:
a unbound list box
and made the Row source as the query which displays the relevant information from second table
This query was created using primary key displayed in form (I mean the [Forms]![Form Name].[Field] ) as the where clause.
But the results returns blank. I'm Stuck here. I'm not sure if the query is not working due to the Input Mask or because of something else. Please help me. Thanks in advance
You should add to form field listbox, and set following values:
Data: primary key of your first table
After this, that field will duplicate ID value. Now you should transform RecordSource of this field in order to see contents from second table. So you should set:
SELECT [PrimaryForeignKeyID], [DetailedField] FROM tblSecond;. Actually I don't know the contents of your second table. Whereas PrimaryForeignKeyID is a field that links second table to first, so-called FK.
After this set following properties of list box:
ColumnCount = 2
ColumnWidth = 0;2
AllowEdits = False
Save form and open it for viewing.
In this case, your listbox will show the associated contents of second table on form.
So to my mind it is better for you to do such simple tables and forms, and you'll realize idea.

Passing Table and Column as method parameters

I am working on a VB.Net app that is connecting to a database with LINQ. Right now I am creating search fields for different parts of the database which have autocomplete text boxes, where I want the AutoCompleteSource to be specific fields in a table.
For example, the text box for the Part Number search would have all of the data from the Part_Number field in my Parts database.
I am wondering if there is a way to implement a method where I can write a simple query like: From t in tbl Select field where both tbl and field are parameters for the method for the Table and Field respectively.
I've tried programming a query like my small example above, and while the From t In tbl part does not initially present me with errors, Select field gives me the error:
Range variable 'field'hides a variable in an enclosing block or a range variable previously defined in the query expression.

Using extended properties (attributes) to columns in an SQL table for defining how data should be input later on

I have never used SQL. I would like to create a table with different columns. Then I would like to create a program which allows the user to insert entries. For each token of the entry, I would like to retrieve from an attribute of the corresponding column the way this particular part of the data entry should be entered. For example, I will have some data retrieved automatically (e.g. the date and time), some for which I will propose the user to insert the last added value, and some for which I will ask the user to explicitly type the value.
I do not know if "Attribute" is the right term; the attributes that I have available for each column at the moment are "Name", "DataType" and "Description"
I want that my program dynamically adapts to the table columns and to the property of each column, especially because I will have several tables to be filled. So my program would check the table columns with their properties, and interact with the user for the creation of a new entry.
Is there a possibility to add attributes to a column?
Otherwise I will have to encode the information I need for my program in the "Description" field (aka "MS_Description").
I googled terms like "sql add column attribute", but I could only find results concerning how to add a column to a table.

Iterate over columns of a report to dynamically show/hide them?

I want to try and implement a parameter which will allow users to dynamically choose which columns are going to be shown in a report. An idea is to create a multiple value parameter which has column names. After user hit View Report I want to try iterate over columns and selected values to join visibility.
How I can iterate over columns inside a tablix?
How I can iterate over multiple values of a parameter, so I can find if some value is selected or not?
I am using MS SQL Reporting Services 2012.
For a table, i.e. fixed columns, you can use the following approach. It's not really loop based so much as an individual distinct visibility check for each column based on a parameter selection.
Set up a multi-valued parameter that lists the columns that can be displayed/hidden.
Then, for each of these columns in the actual table, set the Column Visibility to use an expression based on the parameter:
The expression would something like:
=IIf(InStr(Join(Parameters!IncludedColumn.Value, ","), "Col1") > 0, false, true)
What this is doing is constructing a string of all selected values for the IncludedColumn parameter, then checking if a certain column identifier is included; Col1 for this particular column. You'd use different constants for each column.
So when running the report this approach can hide/display columns based on a parameter selection.
All columns selected:
Some columns selected:

Values not showing in Access form combo box

I have an application in Access 2003 that I am working on. In it, I have an employee table, which is connected to two other tables. The two connected tables are tables that hold a few fixed KeyWords. In my main employee table, I just have the ID from the other table, rather than having the whole word.
I wanted to make a form for entering data into these tables, so I made a query from the three tables that shows the all the regular fields of the employee table except instead of those two ID's, I showed the words themselves.
I then made the form and set the query as the RecordSource. The fields that have keywords are Combo boxes on my form, and their ControlSource is the keyword field from the query (like I mentioned earlier, the value can only be one keyword out of a list). Now, the problem I face is this: When I want to see a single record, it shows the correct value in the ComboBox, but when dropdown the menu, it doesnt show any of the other values.
What is the best way to do this? Am I doing this in the wrong way?
Thank you
I'd approach this slightly differently, set the combo box Row Sources to include both the id and text fields (you can hide the ID column if required by setting it's width to zero). Now add the ID fields to the employee query; you shouldn't need to join the other tables to the Employee table in this query, these fields are foreign keys and the combo boxes should show the text for you automatically. Set the form Record Source to this query, now set the combo box Control Source to the appropriate ID value from the form Record Source.
If you let the wizard build a form for you based on the Employee table you will see this approach in action.
ControlSource is the column name of the table where any user entry will be saved.
RowSource is where you type the name of the saved query or manual query typed directly into that field, which is used to provide a list of available drop down options for the combo box.
RowSourceType should be set to Table/Query, which is based on aforementioned RowSource method.
Now to correct the problem of only displaying what you begin to type (i.e. "Allow AutoCorrect" in Property Sheet > Other) or already have saved for that record without other options appearing after clicking the drop down is the following:
In Design View, click the combobox in question.
Property Sheet > Format > Column Count = set the desired number of columns to display in drop down.
Property Sheet > Format > Column Widths = set the desired width of column in the drop down.
Property Sheet > Format > List Width = set the desired width of the drop down itself.
Property Sheet > Data > Bound Column = set to the column of query table (i.e. 1 for ID and 2 for list options, if you only have two entries)
Note: If your desired drop down options are column two and not column one (makes things easier btw) then do the following change from above:
Property Sheet > Format > Column Count = set the desired number of columns to two.
Property Sheet > Format > Column Widths = add two entries 0",1" which means the ID field is not visible (0") and the options field is one-inch.
The easiest way to sort this out in the beginning is to view the column header names to know what you are looking at in the meantime by doing the following:
Property Sheet > Format > Column Heads = set to yes. At least you will know what is showing and whether or not you are on the right track.
I had this same issue in access 2016 and the issue was with my datatype. The combo box didnt accept 'Longtext' so i just changed datatype to 'shorttext' instead and all the values appeared.
You have set the query as the recordsource for the form. A form only shows (and ties to) ONE record at a time.
Since you want the combo box to show all the values, you should set the RecordSource of the ComboBox to your query.

Resources