Cognos reports multiple comments - cognos

I have a report that returns comments added from a user on a Work Order, however, it only shows the first comment. How can I set up the report so that it will show all comments, including date/time stamps?

Is there a Work Order Table and a seperate comments table, in a header/detail relationship?
IE. WORK_ORDER table has a WO_NUMBER field
WORK_ORDER_COMMENTS table has a corresponding WO_NUMBER, then multiple records per work order, one record for each comment?
If that is the situation, then that relationship is defined in framework manager. It should be something like '1 to n' records, and 'n to 1', such that the Work Order table has 1 record and the Work Order Comments table has n records.
If their relationship is defined '1 to 1' then Cognos will grab the first comment it finds for a Work Order, and return 1 comment per work order.
If you can, please provide more details, such as What version of Cognos you are using, what the tables/key fields are, and how they are mapped in your framework manager.

Related

What is the best way to move out-of-order Access records into the proper order by using a locked ID field?

I have roughly 1500 records in an Access database. I have a field ID that acts as the primary key, and as such cannot be manually changed. After looking through the original Excel sheet these records were kept in, I noticed that a few records in Excel were missing from the Access database. After going through all of them, I added the three missing records into Access.
This database stores records in date order, grouped by a manufacturer. Ex. records from Manufacturer1 collected during week 1 of June '16 are all located together, and records from Manufacturer2 collected during week 2 of June '16 are stored directly afterwards. This is important for us because the data in this database often needs to be looked at visually, so keeping things in date order is essential. There is also a macro that export the data to an Excel sheet and formats it to be easier to read, which exports the records in the order in which they are stored (by the ID field). This is a problem because the three missing records are from years past - now they are in the middle of records from 2018. The IDs they were assigned upon entry keeps them in that location.
Is there a way to reliably insert these records into the database in the location at which they should be? Such as shifting the values of other records ID fields down by 3 to allow room for the missing records? I know I can probably manually have those three records move to the desired location in the macro that exports to Excel, but I'd rather have a less hacky solution that could work if a similar problem happens again.
The order of data in a database is of no interest to the database - it's the relation between data that matters.
To always view your data in the order you want use the ORDER BY clause in an SQL statement. Generally you can add data to the underlying table directly through the query - unless you've got many-to-one type queries where your update would need to affect more than one record.
SELECT FieldName1, FieldName2, . . . .
FROM MyDataTable
ORDER BY Manufacturer, Date
Edit: Even here you'll be adding new records to the bottom of the dataset, but refreshing the query will move the records to the correct order.

Responsys - How to field merge multiple rows on one column using RPL?

Basically, I need to field merge a field in a certain table. Let's say TableA.Col1.
The syntax ${TableA.Col1} works perfectly. However, it only shows the first row of data in the table, whereas, I need to field merge the second row of the data as well.
Any suggestions?
I am trying like an array call ${TableA.Col1[0]} or ${TableA.Col1[1]} but no luck.
Hope to meet some Responsys guru here.
Thank you!
You need to use the <#data> directive to pull multiple records from a supplemental table. Interpolations with Table.Column syntax are designed for 1->1 relationships so will only pull the 1st record.

Show specific document on top in search for specific keywords in solr

Suppose, I have 1000 sellers (S1.....S1000) of Apparels listed on my site. Since all the sellers are paying some amount to me, I am giving them equal weight-age, and the results are shown based on relevancy.
Now, I am planning to start with premium service, where I am thinking to list one supplier on top for each keywords in search results. Let say, S1 has been given premium search for keywords 'Jeans', so if a user searches 'jeans', I first wants to display this supplier on the top, then display other supplier based on relevancy. Plus, this premium service is for only for one month. So, another supplier say S2 can avail this service in next month and so on.
Is there any plugin, wherein I can store which supplier should be shown for which keyword. I am even OK with making 2 queries to meet the desire results.
Please suggest
I think the Query Elevation Component is your friend, you can configure which documents (and hence which suppliers) come first for any given query, see
https://wiki.apache.org/solr/QueryElevationComponent
If that's too much work, you could also add a new boolean field in your documents, indicating whether the document is to be promoted or not, and in the query, sort by this field first (so promoted documents come on top), and by score next (so most relevant documents come right after the promoted ones).
You can maybe also use the reRanking Componant :
https://cwiki.apache.org/confluence/display/solr/Query+Re-Ranking
With using a query like this :
q=jean&rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=3}&rqq=(brand:S1)
The top 1000 of results from query jean will be re-ranking thanks to the boost (of 3) add to the documents which contain the field brand with the value S1.
It can be useful, but in your case I think the QueryElevationComponent is the best.
Be careful, reRanking is only available since version 4.9.

Access Crosstab Report

I am fairly new to access and have a database report issue I can't seem to figure out (even with several posts on the topic :/ )
The database houses audit information from 200+ stores. The audit answers are text, not numeric, and the audit date can be any day. I want to create a report that lists the audit question as row headers, the most recent three audit dates as column headers, and the audit answers as the data.
I have a form that allows the user to select the store, and that feeds the crosstab query. It works, except it does not limit to most recent three dates. The table that feeds the query also lists visit number, so I thought I could do something with the max of visit number but to no avail.
The main issue though is now I cannot get a crosstab report to generate any data. I have found several example pieces of code from back in the day that I have tried, but each tries to generate a row and grand total. Since these are text data fields, the totals will not work and while I have tried removing the pieces of code I think are appropriate, it still does not generate the correct report.
A second option I thought of trying was to export the crosstab query to excel but I am also stuck there.
Any help would be VERY appreciated. Thank you!
Depending on your skill level, this may be difficult. My approach would be a bunch of subqueries, but it won't be pretty. Let's say your stores are uniquely identified by StoreID, your audit dates are Audit Date, and your audit results are in a single text field AuditResults. It'll be up to you to figure out the details, but here's a rough outline:
Get all your data into a single table with 1-3 rows per StoreID (1 per audit date):
Make a simple query that groups by StoreID and returns max (AuditDate). Call it Qry1a.
Join Qry1a back to the audit table to return the results from the most recent audit. Include a daterank column that is hardcoded to 1. Call it Qry1b.
Repeat a and b two more times to get the results from the 2nd and 3rd most recent audits (You can left join onto Qry1 and Qry2 to remove those results). Call those Qry2b and Qry3b.
Using inner joins with your source table and Qry1b,Qry2b, and Qry3b, make a query that return a max of 3 rows per StoreID.
With this new table, make a new query and group by StoreID:
For the first columns, you'll use something like LastAudit: max(iif(DateRank=1,AuditResults,""))
Repeat the previous step to get the next 2 audits changing daterank to 2 and 3 respectively.
The advantage of this approach is that it can handle stores with less than 3 audits or if you have a constantly changing list of stores (because storeIDs aren't hardcoded anywhere).

How can I delete records from a table that have certain criteria

Rookie question I know.
I have a table with about 10 fields, one of the fields is a category field. I need this field to exist because of the multiple types of categories. However, one category in this field is wrong and is duplicating results.
So can I delete all records in the table that have "Type320" in the CatDescription field, and how? I want to keep eveerything else as it is in this table; just need to get rid of the records that have that that in that one field
Thanks very much!
EDIT: Thanks for the answer, I did not know how to do this so this is very helpful
However, this is more complicated than I thought. The raw data that I am supplied carries these duplicate records (only duplicate in certain circumstances but they are easy to isolate). This raw data is given to me on a monthly basis in several spreadsheet forms.
It all relates to these ID numbers, and has like 10 fields (xls columns). As I said before one of these is the Category Description field (sorry, this is not a lookup) In certain places this records automatically duplicates itself on output because in the database this comes from, it has to have this sub category for one particular "type"
So....every time there is a duplication, every single bit of information in all fields are exactly the same, with the exception of this CatDescription (one is Type320, and the duplicated record type is "Type321"). However, there are some instances where Type321 is valid on it's own (in which case there is no matching data row with a Type320 catdescription). By matching I mean all data in all fields of a particular record.
A very clear absolute of this is if all fields (data within) of a record with Type320 CatDescription, matches all fields (data within) a record with Type321 CatDescription, then I can delete that record containing Type321 CatDescription. This is true because this is the only situation where this duplication occurs, normally not all of this should match.
This allows all unique records with Type320 and Type321 data (that does not match exactly) to stay; just a it should. This makes sense to me (and hopefully you too :/) but can it be done, and how?
thanks because this is way over my head. I would rather know how to do it in access, but an xls solution is equally as appreciate. heck i would do it in ppt if it would get the job done! :)
I would try with one of these two querys:
DELETE FROM table WHERE CatDescription LIKE '%Type320%';
DELETE FROM table WHERE CatDescription LIKE '*Type320*';
That because the Access database engine could be using * (ANSI-89 Query Mode e.g. DAO) instead of % (ANSI-92 Query Mode e.g. OLE DB/ADO) for the wildcards.
Alternatively, this regardless of ANSI Query Mode:
DELETE FROM table WHERE CatDescription ALIKE '%Type320%';
Note the Access database engine's ALIKE keyword is not officially supported.
Does the CatDescription field look to another table? Is it a a query of those tables that creates what you call duplicate results?
If so, be careful about blaming the table that has CatDescription. Check the look-up table to see if Type320 is found there in duplicate.
If you don't have the problem isolated correctly, then you're likely to delete good records while not fixing the problem.

Resources