Cognos analytics multiple measures in a single cell - analytics

Is it possible to put multiple measures in a single crosstab cell? For example, put a 2x2 table in a cell and drop a measure in each cell of the table? I've tried doing that and the values just repeat across rows.

If you have a crosstab with time on the column edge and product line on the row edge, you can nest the Quantity and Revenue measure under the time, then set the box type to none on the labels so it looks like two values in a single cell. You may need to play around with the borders a bit too.
Here is a sample spec:
<report xmlns="" expressionLocale="en-us" useStyleVersion="11.5">
<page name="Page1">
<defaultStyle refStyle="pg"/>
<defaultStyle refStyle="pb"/>
<contents><crosstab horizontalPagination="true" name="Crosstab1" refQuery="Query1">
<defaultStyle refStyle="xm"/>
<staticValue>No Data Available</staticValue>
<CSS value="padding:16px;"/>
<CSS value="border-collapse:collapse"/>
<defaultStyle refStyle="xt"/>
<crosstabColumns><crosstabNode><crosstabNestedNodes><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Revenue" edgeLocation="e3"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles><CSS value="display:none"/></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Quantity" edgeLocation="e4"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles><CSS value="display:none"/></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabNestedNodes><crosstabNodeMembers><crosstabNodeMember refDataItem="Year" edgeLocation="e1"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents><propertyList><propertyItem refDataItem="Revenue"/><propertyItem refDataItem="Quantity"/></propertyList></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabColumns><crosstabRows><crosstabNode><crosstabNodeMembers><crosstabNodeMember refDataItem="Product line" edgeLocation="e2"><style><defaultStyles><defaultStyle refStyle="ml"/></defaultStyles></style><contents><textItem><dataSource><memberCaption/></dataSource></textItem></contents></crosstabNodeMember></crosstabNodeMembers></crosstabNode></crosstabRows><crosstabIntersections><crosstabIntersection row="e2" column="e3"><style><CSS value="border-right-style:none"/></style></crosstabIntersection><crosstabIntersection row="e2" column="e4"><style><CSS value="border-left-style:none"/></style></crosstabIntersection></crosstabIntersections><crosstabFactCell><contents><textItem><dataSource><cellValue/></dataSource></textItem></contents><style><defaultStyles><defaultStyle refStyle="mv"/></defaultStyles></style></crosstabFactCell></crosstab></contents>
<queries><query name="Query1"><source><model/></source><selection><dataItem aggregate="none" rollupAggregate="none" name="Year"><expression>[Sales (query)].[Time].[Year]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="1"/><XMLAttribute output="no" name="RS_dataUsage" value="0"/></XMLAttributes></dataItem><dataItem aggregate="none" rollupAggregate="none" name="Product line"><expression>[Sales (query)].[Products].[Product line]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="3"/><XMLAttribute output="no" name="RS_dataUsage" value="0"/></XMLAttributes></dataItem><dataItem aggregate="total" name="Revenue"><expression>[Sales (query)].[Sales].[Revenue]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="2"/><XMLAttribute output="no" name="RS_dataUsage" value="2"/></XMLAttributes></dataItem><dataItem aggregate="total" name="Quantity"><expression>[Sales (query)].[Sales].[Quantity]</expression><XMLAttributes><XMLAttribute output="no" name="RS_dataType" value="1"/><XMLAttribute output="no" name="RS_dataUsage" value="2"/></XMLAttributes></dataItem></selection></query></queries><XMLAttributes><XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/><XMLAttribute output="no" name="listSeparator" value=","/><XMLAttribute output="no" name="decimalSeparator" value="."/></XMLAttributes><modelPath>/content/folder[#name=&apos;Samples_LG_DQ&apos;]/folder[#name=&apos;Models&apos;]/package[#name=&apos;GO Sales (query)&apos;]/model[#name=&apos;model&apos;]</modelPath></report>


I can't change range and/or default values in DevExpress Dashboard

I have a page where users register and can make their personal diet plan etc.
I am trying to make some graphs with built-in VS dashboards.
I am using VS 2015 and SQL Server Management Studio 15.0.18206.0 if that matters.
My problems are the following:
Automatic (SUM)
Dashboard values default to SUM function, which I am not able to change, as you see in the first picture, but I kind of managed to solve this problem with the help of SQL (SELECT DISTINCT, SELECT TOP(1) etc.)
Automatic (SUM)
Default year count
When I am trying to make a dashboard to show track of user's vitals and activity, which is the core of my statistics, time defaults to YEAR and the result end up like the second picture.
Default year count
There is nothing I can do to change these and I just made irrelevant graphs to fill the page, but it's a shame because I planned to make a lot of graphs with the table you see in the third picture.
User History table
If it helps, the XML code generated from the last dashboard is this:
<?xml version="1.0" encoding="utf-8"?>
<Title Text="YearDashBoard" />
<SqlDataSource ComponentName="DataSource1">
<Connection Name="foodConnectionString" FromAppConfig="true" />
<Query Type="SelectQuery" Name="UserHistory1" Distinct="true">
<Table Name="UserHistory" />
<Column Table="UserHistory" Name="CaloriesDate" />
<Column Table="UserHistory" Name="DailyCalories" />
<Column Table="UserHistory" Name="UserID" />
<Filter>[UserHistory.UserID] = 17</Filter>
<ConnectionOptions CloseConnection="true" CommandTimeout="0" />
<Chart ComponentName="chartDashboardItem1" Name="Chart 1" DataSource="DataSource1" DataMember="UserHistory1">
<Measure DataMember="DailyCalories" DefaultId="DataItem0" />
<Dimension DataMember="CaloriesDate" DefaultId="DataItem1" />
<Argument DefaultId="DataItem1" />
<Pane Name="Pane 1">
<Value DefaultId="DataItem0" />
<LayoutGroup Weight="100">
<LayoutItem DashboardItem="chartDashboardItem1" Weight="100" />
Finally, with the help of DevExpress technical team, I found out that the whole time there was an invisible scroll bar, but you had to mouse over it (!) while being on the "BINDING" tab of the menu.

How to publish additional postgis raster layer attributes in geoserver?

i was wondering if any of You can help me with my problem. I'm storing some rasters in Postgis database. Each raster is in its own table and besides 'rid' and 'rast' columns, I manualy added other columns to store raster attributes such as 'metadata'...
I have successfully imported rasters in geoserver using ImageMosaic JDBC and in Layers Preview (OpenLayers) I can see rasters and use getFeatureInfo function, but the problem is that function getFeatureInfo returns table with correct pixel value , 'rid' field is empty (only table header apears) and no other attribute is shown (not even attribute header in table). I'm using default geoserver method for layer preview function. file
<!-- possible values: universal,postgis,db2,mysql,oracle -->
<spatialExtension name="pgraster"/>
<masterTable name="mosaic" >
<coverageNameAttribute name="name"/>
<maxXAttribute name="maxx"/>
<maxYAttribute name="maxy"/>
<minXAttribute name="minx"/>
<minYAttribute name="miny"/>
<resXAttribute name="resx"/>
<resYAttribute name="resy"/>
<tileTableNameAtribute name="tiletable" />
<blobAttributeName name="rast" />
<keyAttributeName name="rid" />
<textAttributeName name="metadata" />
<!-- value DBCP or JNDI -->
<dstype value="DBCP"/>
<!-- <jndiReferenceName value=""/> -->
<username value="postgres" />
<password value="postgres" />
<jdbcUrl value="jdbc:postgresql://localhost:5432/web_kartografija" />
<driverClassName value="org.postgresql.Driver"/>
<maxActive value="10"/>
<maxIdle value="0"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE ImageMosaicJDBCConfig [
<!ENTITY mapping PUBLIC "mapping" "">
<!ENTITY connect PUBLIC "connect" "">]>
<config version="1.0">
<coverageName name="jan"/> <!-- Name of the table in database -->
<coordsys name="EPSG:4326"/>
<!-- interpolation 1 = nearest neighbour, 2 = bilinear, 3 = bicubic -->
<scaleop interpolation="1"/>
<verify cardinality="false"/>
I tried to include <textAttributeName name="metadata" /> as a column name where aditional data is stored, but still no effect. Can anobudy help me with this problem ? Thanks in advance !

mapnik not rendering postgis multipolygonzm?

So I loaded a bunch of NHD data, and the geometry ended up as MultiPolygonZM (and pointZM and areaZM for other tables)
way geometry(MultiPolygonZM,900913)
I've tested the query and its returning data when run against the db directly. Here's my style:
<Style name="waterways">
<LineSymbolizer stroke="blue" stroke-width="3" />
<Layer name="waterways" status="on">
<Parameter name="table">
(select way
from nhd_waterbody)
as waterway
<Parameter name="type">postgis</Parameter>
<Parameter name="port">5432</Parameter>
<Parameter name="user">gisuser</Parameter>
<Parameter name="dbname">gis</Parameter>
<Parameter name="estimate_extent">false</Parameter>
<Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>
But I can't get mapnik (version 2.10) to render it. The osm data is rendering just fine (its standard MultiPolygon, not 4d) from mapnik and qgis (v1.8) map all of it just hunky dory. Has anyone else experienced anything like this? Is it a geometry problem or is that just a red herring? Is there anyway to get mapnik to spit out any type of debug info when rendering?
-- Randy
Several GIS programs, such as QGIS, internally use ST_Force_2D to make a 2D drawing from higher-dimension data types. I'm not sure how Mapnik treats these geometries, but I suspect they might not be supported. Also, be sure to double-check the extent, since this is often overlooked.
If you are not actually using the higher dimensions, then remove them! For PostGIS 2.0:
ALTER TABLE my_table
ALTER COLUMN way TYPE geometry(MultiPolygon,900913) USING ST_Force_2D(way);
And for PostGIS 1.x, see this answer.

Jasper Report (iReport) Pie Dataset from main dataset

I want to use a pie chart per group in Jasper iReport, but I don't know how to create a dataset per group.
Assume I have a table as follows:
Table users
category - user - status
Then I have a the following SQL
select * from users order by category
My display has a simple group band of category with detail showing each user and their status. Ideally I would have each category group header show a pie chart with all the distinct statuses and their counts within that group. I'm at a loss as how to do this in iReport.
If I knew all the categories ahead of time I could just create a dataset for each one using the following:
select status, count(user) from user where category = <current category> group by status
I'm attempting to do this using a JRMapCollectionDataSource that resets each group and pulls the data from the rows in the group using a variable, but I'm not very familiar with the whole reset group and increment paradigm.
Any help?
You can solve this issue without programming following this steps:
sort data by category field and by user field (add sorting via iReport or adding ORDER BY clause to the query in case having deal with jdbc datasource);
add two groups: the 1st group - for category field and the 2nd group - for user field (via iReport). Note: It is not necessarily to add GROUP BY clause to the query;
add Pie Chart component to the Group Header band for the category field;
set evaluationTime and evaluationGroup properties for this pieChart.
Here is working sample for demonstrating how to build Pie Chart. In this sample I've used the csv file as datasource.
The chart shows the quantity of users for every category. I used variable usersCount for counting users in every group, but it is was possible to use built-in variable $V{userGroup_COUNT}.
Here is my jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ...>
<field name="category" class="java.lang.Integer"/>
<field name="user" class="java.lang.String"/>
<field name="status" class="java.lang.String"/>
<sortField name="category"/>
<sortField name="user"/>
<variable name="usersCount" class="java.lang.Integer" resetType="Group" resetGroup="userGroup" calculation="Count">
<group name="categoryGroup">
<band height="135">
<chart evaluationTime="Group" evaluationGroup="categoryGroup">
<reportElement x="158" y="0" width="200" height="135"/>
<dataset resetType="Group" resetGroup="categoryGroup" incrementType="Group" incrementGroup="userGroup"/>
<reportElement x="0" y="0" width="100" height="20"/>
<textFieldExpression><![CDATA["Category: " + $F{category}]]></textFieldExpression>
<group name="userGroup">
<band height="79" splitType="Stretch"/>
Here is my csv file (data file - datasource):
The result will be (via iReport preview):

iReport, how to print fields of different table

I need multiple queries in my report so i added a new dataset.
The problem is i can't use fields of new dataset in my report, the error is: field does not exists.
So, how can i have multiple query in my report(to print fields of different table) without create a subreport for each field?
Unfortunately this isn't how iReport works. You need to get all your data into one dataset to use the fields side by side. See #GenericJon's detailed answer on using a datasetRun where your fields are used as input parameters to define another dataset.
If you really want the parameters can be used to pass a field for output in a datasetRun. This outputs Dataset1>Field1 / Dataset2>Field2.
<subDataset name="TotalUsers">
<parameter name="Users" class="java.lang.Integer" isForPrompting="false"/>
<parameter name="Date" class="java.util.Date" isForPrompting="false"/>
<queryString language="SQL">
<![CDATA[CALL GetTotalUsersAtDate($P{Date})]]>
<field name="TotalUsers" class="java.lang.Long"/>
<reportElement x="0" y="78" width="555" height="16"/>
<jr:list xmlns:jr="" xsi:schemaLocation="" printOrder="Vertical">
<datasetRun subDataset="TotalUsers">
<datasetParameter name="Users">
<jr:listContents height="16" width="555">
<textField pattern="#,##0.00 %" isBlankWhenNull="true">
<reportElement style="table_TD" x="475" y="0" width="80" height="16"/>
<reportElement style="table_TD" x="0" y="0" width="475" height="16"/>
<textElement textAlignment="Left" markup="none"/>
<text><![CDATA[Proportion of total users]]></text>
I would go further to suggest you do as much of the math and collating outside of iReport too, i.e. use stored procedures if your data source is a database.