Cognos - Not same value in Query Studio and Report Studio - cognos

In Framework Manager I have a query element which calculates the distinct number of a dimension (count distinct for the aggregation in the properties).
In the database, the total of distinct number is 15720813 (so the good number).
Then when I wanna test this object in Query Studio the number displayed is 15723470 which is the total number of records in the table so that's wrong.
But in Report Studio the number displayed is 15720813 which is the good number.
Why Query Studio and Report Studio don't display the same number?
Thanks in advance.

You can check the aggregate property in query studio of the element you are trying to test. It is available below the menu in query studio.
It might be you are using different elements. Please check and retry. If not then I would suggest going back and recreating the entire element.

Related

Sharepoint 2013/2016 Calculated Column stops calculating

I have a calculated column in SharePoint On-Premises that shows the number of days till a due date which works perfectly for a day or so then stops calculating, but if I go to the list settings and click the column and click ok then it calculates again?
Has anyone experienced an issue similar to this. I had this issue in both 2013 but within a few weeks moved to 2016 and still the same issue.
I've tried " " blank and also "" empty so not sure if that is causing the issue??
Is it a problem with the formula?
Here is the formula:
=IF(ISBLANK([Due Date])," ",
IF(ISERROR(DATEDIF(NOW(),[Due Date],"d"))," ",DATEDIF(NOW(),[Due Date],"d")))
Calculated columns cannot contain volatile functions, which includes those that depend on the current date.
The values in SharePoint columns--even in calculated columns--are stored in SharePoint's underlying SQL Server database.
The calculations in calculated columns are not performed upon page load; rather, they are recalculated only whenever an item is changed (in which case the formula is recalculated just for that specific item), or whenever the column formula is changed (in which case the formula is recalculated for all items).
If you need to show a dynamic value that changes with the passage of time, you have a few alternatives.
Client-Side Rendering
Consider using client-side rendering which lets you use JavaScript to dynamically determine how records in a list view are displayed. This JavaScript runs upon page load, so it can handle current time-dependent values much better than a calculated column.
To use client-side rendering, you create a JavaScript file that controls how the view displays. You upload that file to somewhere on SharePoint where people will have at least Read access to it, then edit the list view web part that you want to display differently and set its "JSLink" property to point to your JavaScript file.
Check out this answer for an example of using a JSLink file to spoof a dynamic date field.
Microsoft also provides some documentation here but I think they do more work than is necessary (creating an entire new list definition project in Visual Studio for their example instead of just creating a JSLink JavaScript file for an existing list).
Other Options
A few other options are mentioned in the older question linked above:
Conditional Formatting: You can apply conditional formatting to highlight records that meet certain criteria. This can be done using SharePoint Designer or HTML/JavaScript.
Filtered List views: Since views of lists are queried and generated in real time, you can use volatile values in list view filters. You can set up a list view web part that only shows items where Created is equal to [Today]. Since you can place multiple list view web parts on one page, you could have one section for today's items, and another web part for all the other items, giving you a visual separation.
A workflow, timer job, or scheduled task: You can use a repeating process to set the value of a normal (non-calculated) column on a daily basis. You need to be careful with this approach to ensure good performance; you wouldn't want it to query for and update every item in the list if the list has surpassed the list view threshold, for example.
To expand on the Filtered List Views option, you can have a view that shows only items that are due within a certain number of days. For example, you can display all the items due within 7 days by filtering where the Due Date field is less than [Today]+7 and Due Date is greater than or equal to [Today]. You could also sort the view to show the items with earlier due dates closer to the top.

Auto sum fields in visual studio

When I add fields for this report Visual Studio automatically puts "Sum" in front of the field. Can anyone tell me what this is/how to fix it? For example:
I am trying to add the field "AorFCrnt" into a table. On the drop down list the field is labeled correctly but when it is added to the table it reads [Sum(AorFCrnt)]. It does the same thing for any other field I have available.
Thanks!

SSRS Tablix filter out NULLs

I'm using Visual Studio 2012 and SQL Server 2012.
I'm working on trying to filter out records in my Matrix and I have a column group called Description which is grouping records by Open, Assigned, Completed and NULL values. I'm currently trying to filter out that column group so that it only shows Assigned and Completed...and filters out the Open and the NULL.
I know that I right click on Tablix Properties and go to Filters, and I choose Description <> Open and it works. But how do I filter out the NULL records in that same section?
You can filter on nulls by using a formula like this:

ViewPanel sortable column using Relational Data

I recently attended the "Access Data from XPages with the Relational Controls" webinar hosted by Teamstudio and presented by TLCC. It was a very informative class and one topic covered was about enabling a column to be sortable in ASC/DESC order by simply clicking the column header.
Well, in a project I am currently working on we do have a DB2 backend where the viewPanel data uses a jdbcQuery with the sqlQuery parameter. I thought this was possible when starting the project and could never get it to work, then after seeing it discussed during the webinar figured I would give it another attempt.
Here are the All Properties for my viewPanel:
Here are the All Properties for the column I wish to sort:
Previewed in IE with column Unsorted
Previewed in IE with column sorted ASC
Problem
Clicking on the column heading sorts the column in ASC order, but on subsequent clicks doesn't sort in DESC or reset the sort.
Question
Is there something I am missing to make this work or was this issue fixed in a version after 8.5.3?
System
IBM Notes Designer: 8.5.3FP3
OS: Windows/Longhorn/64 6.2
Server Build: Release 8.5.3FP6
Try taking out the scope on your data (you have request).

Query problem with lookup column in SharePoint

Setup:
I have two lists on a SharePoint site, A and B. List A has a column 'b' that is a lookup to the ID field of list B. I have 500k+ records in A and about 6k records in B.
What works:
I am able to execute a query for items in list A using SharePoint web services, and am even able to filter the query based on a specific "lookup" value for column 'b'. For example, I can query for items in A whose column b matches 1234 (...<Value Type="Lookup">1234</Value>...), and so on.
What doesn't work:
The query does not work for items older than a specific date, even though my query does not involve dates in any way -- only the lookup column. Any query on data newer than two years old works fine, anything older than that fails. If I view items from the SharePoint web page they appear ok, and all the links from child records in B to parent records in A work just fine -- the lookup columns appear intact.
Question:
Is there some kind of maintenance task in SharePoint that can cause some underlying data to get corrupted that can prevent a query based on a lookup id to stop working, like a system restore, etc? In other words, the lookup column data appears correct on the surface in the web browser. But does SharePoint represent this value with a GUID or other invisible data that might be out of sync or stale?
Thanks.
Maybe you are hitting another limit; the maximum number of items retrieved in a query?
See list throttling
Try querying by the ID by adding the LookupId=”TRUE” attribute to your FieldRef element.
http://abstractspaces.wordpress.com/2008/05/05/caml-query-lookup-field-by-id-not-by-value/
The problem appears to be related to the fact that the column in question was indexed. When I removed the index everything started working. When I reapplied the index, everything kept on working. I'm attributing this problem to a corrupt index.

Resources