How do I group dates in IBM COGNOS when building a front end dashboard - date

I am an extreme newbie to COGNOS (5 days give or take a few hrs) and have been thrown in the deep end.
I have a data package i am working with and the only date field I can use has the property of timestamp. I have looked through other questions that are similar and i have used the "CAST" function to turn the field into a date so this has worked.
cast ( [TR_Logical Layer].[Fact Event].[Period Datetime],DATE) - so I was happy with that.
However now when I am building the graph, I am getting repeated dates - and I can only think that this is because somehow it is still holding onto the timestamp portion of the field.
Please how can i get all of my many dates for say the 21st Jul to be one?

Possible issue: Repeating is probably due to how it is grouped (down to the time which would have the day repeating)
Suggested solution: Add a determinant to control granularity and grouping
Here are the steps
https://www.ibm.com/docs/en/cognos-analytics/11.1.0?topic=determinants-specifying
Click the query subject you want, and click Actions, Edit Definition.
Click the Determinants tab.
Click Add under the Determinants box.
The entry New Determinant displays in the box. To give this entry a meaningful name, right-click it, and click Rename.
To define a key, right-click a query item in the Available items box and click Add as Key. Tip: You can also drag query items to the Key box.
To identify which query items should be associated with this determinant, right-click query items in the Available items box, and click Add as Attributes.
Tip: You can also drag query items to the Attributes box.
You can have a determinant with no attributes defined for it. Framework Manager uses this type of determinant to indicate which query items are indexed.
To specify that the selected determinant should be used as the unique identifier, select the Uniquely Identified check box.
Do this only if the data in this item is unique for every row in the underlying data source. You can specify more than one unique determinant if they are truly unique. At query time, the relationship being used will determine which unique determinant to use.
Select the Group By check box to indicate that when keys or attributes associated with that determinant are repeated in the data, IBM® Cognos® Analytics should apply aggregate functions and grouping to avoid double-counting.
If you want to change the order of the determinants, use the arrow buttons.
Determinants are processed in the order in which they are specified in the model.
Click OK

Related

In Tableau, Is it possible to give Column number in Column Shelf

I'm using Tableau. So, instead of giving the [Column_name], Is it possible to give [Column_number] in column shelf?
- Hariharasudhan. R.
No -- for good reason.
Think of the data source as a template for a potential SQL (or MDX or TQL) query; specifying tables, joins, unions and possibly some where/having clauses for data source filters.
The actual SQL generated for any particular view will be an (optimized) query that only selects columns that are actually needed for that particular view, adds where/having clauses based on the filters being used etc.
So a column doesn't have a fixed number. The same column may be the first field selected in one situation, the last field in another situation, and left off completely in another.
If you want to change the name of column shelf:
Create a duplicate of variable and change original with duplicates and assign name as your wish by right-click on Edit Aliases and change as per your requirement.
Go to Data Source
On the middle right corner check on Show aliases
Go to column and right click on it. Go to Rename

Show calculated measure in row?

I'm using Tableau Desktop 9.0 on OSX. I have data (loaded from a local CSV file) that looks like this:
code,org,items
0212000AA,142,10
0212000AA,143,15
0313000AA,142,90
0314000AA,143,85
I want a chart that shows the number of items beginning with 0212 as a percentage of all items, for each organisation. (I mean as a percentage of the organisation's items - for example, in the above, I would like to show 0.1 (10/(10+90)) for organisation 142.)
I have been able to get part way there, by adding org to Columns, and SUM(items) to Rows. Then by adding a Wildcard filter on code, for starts with 0212.
This shows me the number of items starting with 0212, by organisation.
But what I don't know how to do is show this divided by the value of all items for the organisation.
Is this possible in Tableau, or do I need to pre-calculate it before loading my data source?
One way is to define a calculated field called matches_code_prefix as:
left(code, 4) = "0212"
You can also define a parameter called, say, code_prefix to avoid hard coding the prefix string:
left(code, 4) = code_prefix
And then show the parameter control for code_prefix to allow the user to interact with it.
If you use this new field as a dimension to separate SUM(items) according to those that match the prefix and those that don't, you can then use a quick table calculation to get the percent of total.
For example, you can place org on the Rows shelf and matches_code_prefix on the Columns shelf, and SUM(items) on the Text shelf to make a table. Then under the analysis menu, turn on grand totals for both rows and columns to see the behavior. Next, right click on SUM(items) and choose Quick Table Calc->Percent of Total. Tableau will display the percents of total in the table.
If you want the percent of total defined differently than the default, then right click on the measure again and set Compute Using to a different value such as matches_code_prefix in your case. It's usually better to set compute using to a specific field.
If you only want to display the value for the matching case, select the column header you don't want to see and choose hide. You can also turn off the grand totals from the analysis menu when you are done.
When you are confident in the values in your table, you can turn it into a bar chart for example by moving matches_code_prefix to the detail shelf and the measure to the Columns shelf.
--
The above is the drag and drop approach. If you prefer to hard code everything in a single calculated field that is calculated on the database side, you could instead define a calculation such as:
zn(sum(if matches_code_prefix then items end)) / sum(items)
Then set the default number format for that field to display as a percentage

Displaying Record Once in SSRS Table

I've created a table from a procedure that will display a summary of all incentives from a given collection operation or recruiter in my report. But if the collection operation or recruiter has multiple incentives assigned to their drives during the time period, it will repeat the same collection operation or recruiter on each line. If possible, I'd like to only display the first time it occurs and then leave a blank space until it hits a new collection operation/recruiter.
See screenshot for example:
Is there a way to create an expression to handle this? Thanks,
The answer is Groupings. If you add a row grouping on your "Collection Operation" column it should do a trick. To add a group Right click on your details row. just like you would to add a row. There should be an option to add a parent group. Select that and tell it you want to group on "Collection Operation" and click "Ok". You may have to adjust your formatting a little, but I think this will achieve what you are going for.
I just noticed the recruiter Column. To make that only display once you will need to use an expression. Now that you have a loop you should be able to write an expression that determines your position within the group and blank it out when it isn't the first row.

Filemaker 12 -- display one value, store another

I'm building a database in FileMaker 12 that will, among other things, keep a list of jobs (indicated by numeric ID) and the employees who had billable time for that job.
Given three tables:
Employee ( empName, empID, salary, ... )
JobHours ( empID, jobID, hrsWorked, ... , refID)
JobCost ( jobID, expenses, profit, ... , refID)
Where:
Employee is my personnel roster matching names to numeric employee IDs and stats (salary, et al) ;
JobHours is a list of employee participation -- whenever an employee spends time on a job, this table has a line that shows their ID, the job ID, hours worked, and a few other things;
JobCost is a daily record of jobs. One entry in this table refers to the activity for a single job on a single day. Additionally, each entry gets a system generated unique ID (since neither jobID nor date is unique) to relate to JobHours (resulting in a list of who worked on a particular job on a particular day).
I have a form showing records from JobCost. For each record, I can see in a portal, showing records from JobHours, who worked on that job on that day.
Now, the issue.
In my portal, I want to have a drop-down list of employee names pulled from a value list to create records in JobHours with the following criteria:
1) I need it to be a drop-down rather than a pop-up so it will respond to auto-fill from the keyboard. A drop-down will show the secondary value (employee name) from a value list while dropped down, and will respond properly to keyboard autocomplete on the secondary value, but once you've made your selection, it only displays the primary value (employee ID).
2) I need it to display names, not IDs, at all times. The pop-up does this perfectly. However, it doesn't seem to respond to the keyboard for typing autocompletes.
3) I need to store the numeric ID rather than the name.
I know how to satisfy any two of these criteria at once, but that's all. The whole database is working beautifully otherwise. Is this behavior possible?
One common technique is to use two fields, one directly on top of the other.
On the bottom, put your JobHours::EmpID field. Set it up as the drop-down list with the value list that you've specified.
On top of the JobHours::EmpID field put the related Employee::EmpName field. Set the field so that it cannot be entered in browse or find mode.
Now your users will see the Employee Name, but when they click that click will go through the top field and into the Employee ID field where they will choose the name from the value list.
pft's solution is one that I have long used, but I do still find it inelegant because the user still sees an existing id number in the field when changing the value.
If the type-ahead is important, I would use the popup menu. Once the menu has been activated either by tabbing into it or by clicking into it, the user is able to type from the keyboard and the selection will change based on what's entered.
I came to this thread looking for a solution to this same issue (allowing the user to pick from a list, show their choice, but store a related value instead). For example, choose a plant species name from a dropdown, show the plant species name in the dropdown field, but have it store the taxonomic serial number (TSN; which is more likely to stay the same over the years). This is easy to do in MS Access, but took a litlte more messing around to do it in FMP12.
How I solved it:
I created two fields in the table that would be storing the values: Plant_TSN and Plant_SciName. A relationship must exist between the values in these two fields. In my case, I store a SciName for each TSN in a lookup table. I then created two fields in my layout, one for each new field.
For the value you wish to store (ex. Plant_TSN):
Make the corresponding layout field a dropdown and include the show/hide arrow. Edit the value list you will populate the dropdown with to show the second (reader friendly) column but store the first column value. In the layout shrink the field to only show the arrow.
For the field you wish the user to see (ex. Plant_SciName):
make the other layout field a Edit Box and prevent field entry in either Browse or Find mode. But it up against the dropdown arrow created in the previous step to make what looks like one field.
Finally, back in the first field (arrow-only drop down) write a script to push the user friendly number (Plant_SciName) to the edit box when the user-ugly (Plant_TSN) value is picked in the drop down. I used the OnObjectSave script trigger of the dropdown formatted field. Script should be something along the lines of 1) Freeze window, 2) Go to Related Record (based on relationship in lookup table 3) Set Field (i.e. the edit box) and 4) GotoLayout[original] to offset the Freeze.
Probably not an entirely clear explanation, but I bet you will get it on your third read through! I would have posted a screenshot, but I apparently need 10 "reputation points".
Cheers.

SSRS 2008 limiting scope based on expression

I have a fairly simple problem, but I don't think I understand SSRS and scopes well enough to figure this out.
What I have is a case (one entity) that can have multiple appointments (another entity). Appointments have a date and a status. I want to display the next soonest appointment date and its status. To display the date I'm using
=Min(IIf(Fields!appt_start.Value > Globals!ExecutionTime, Fields!appt_start.Value, Nothing))
The idea is that I first pick only those appointments that occur in the future, and then grab the soonest one. It seems to work great.
Now, I need to apply the same filtering logic, but display the appointment status rather than the date. From my understanding, this is where scopes would come in. I could limit my scope to just the appointment I want, and then show its status. But I don't understand how to do that.
One way to go about this particular problem would be to use a filter in combination with the First function. Add a filter to the table to only show dates greater than the current day. Use a table row with no grouping and use expressions like this:
=First(Fields!appt_start.Value)
=First(Fields!appt_status.Value)
Another option would be to add calculated fields to the dataset to only populate values such as status when the date is greater than the current day. This is useful if you need to show more information later on.
Edit: Yes, you would want to sort the data by date for the First function to work right. You can actually filter at 3 different levels in SSRS. Right-click on your dataset and go to Dataset Properties. Click on Filters. Click Add. Fill in the expression, operator, and value to meet your need. You can also do this in the group properties or the table properties.