Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
CrossTab
Go forward
First of all, sorry for my english langage, I'm trying to make the best translation <br />
I can of the Data native langage wich is french into english one.<br />
Well, what I need to do is a crossTab like the one in the attached picture.<br />
<br />
<br />
Some explanations about the content of the table : <br />
<br />
? In column : groups of species = "groupes d'esp?ces"(flore,invert?br?,oiseaux,amphibiens et reptiles,mamif?res chriopt?res, autres mamif?res) and natural habitats "habitats naturels". <br />
<br />
( groups of species : is a column in a Table in my Database)<br />
<br />
? In ligne : "menace" (nb species threatened or almost threatened ) / "protection" (nb of species protected nationally et regionally) / directives<br />
<br />
? In the cells : number of species or number of naturel Habitat.<br />
<br />
? Total<br />
<br />
Queries:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>"protection":
- number of taxa protected at national and regional taxonomic group for selected common:
select count(*) as nb_especes_protegees, gta_id_groupe_taxonomique
from tv_taxon_observe_commune, t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon from tv_taxons_proteges_region_et_nation_groupe)
and gez_id_geom_zonage = 217609
>(common code)
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique
"Menace":
- number of species threatened or almost threatened with taxonomic groupe for selected common:
select count(*) as nb_especes_menacees, gta_id_groupe_taxonomique
from tv_taxon_observe_commune, t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon from tv_taxons_menaces_quasi_menaces_groupe)
and gez_id_geom_zonage = 217609
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique
"Directives":
- Directive number of species with taxonomic group for selected common
select count(*) as nb_especes_directive, gta_id_groupe_taxonomique
from tv_taxon_observe_commune, t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon from tv_taxons_directive_groupe)
and gez_id_geom_zonage = 217609
>(common code)
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique</pre>
Find more posts tagged with
Comments
kclark
Could I get some sample data from you so I can build an example and reply back with it?
Go forward
Hi Kclark Can I get your gmail acount or whatever kind of email adress in order to send you the SQL queries that can help you to create the tables you are going to be in need in building this tab ?
Cause I got a problem the file cannot be uploaded? I'm not permitted to do that with this kind of file?
Thank's in advance.
kclark
kclark@actuate.com
Go forward
c
mwilliams
What about the crosstab above are you having problems with?
Go forward
Thank's williams for replying,
I have problems to do the crosstab in other words how to group my Datasets wich contain my queries and make
my crosstab look like the one in the attached picture.
Thank's in advance
Hans_vd
Hi Go Forward,<br />
<br />
First of all you'll need one Data Set in order to be able to build you Data Cube.<br />
<br />
So, can you write your query like this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
select 'protection' as category,
count(*) as nb_especes_protegees,
gta_id_groupe_taxonomique
from tv_taxon_observe_commune,
t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon
from tv_taxons_proteges_region_et_nation_groupe
)
and gez_id_geom_zonage = 217609
>(common code)
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique
UNION ALL
select 'm?nace' as category,
count(*) as nb_especes_menacees,
gta_id_groupe_taxonomique
from tv_taxon_observe_commune,
t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon
from tv_taxons_menaces_quasi_menaces_groupe
)
and gez_id_geom_zonage = 217609
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique
UNION ALL
select 'directives' as category,
count(*) as nb_especes_directive,
gta_id_groupe_taxonomique
from tv_taxon_observe_commune,
t_taxon_observe
where tv_taxon_observe_commune.tao_id_taxon in
(select tao_id_taxon
from tv_taxons_directive_groupe
)
and gez_id_geom_zonage = 217609
>(common code)
and tv_taxon_observe_commune.tao_id_taxon = t_taxon_observe.tao_id_taxon
group by gta_id_groupe_taxonomique
</pre>
<br />
Now you have all the dimensions you need to build your cube and crosstab
Go forward
Thank's Hans_vd for replying,
I had create a cross using the query you give me by putting the category in the column for defining rows
for the crosstab and gta_id_groupe_taxonomique in column for definening the columns of crosstab and the
nb_especes_protegees in summary cells but nothing is displaying even if I change the value 217609 with ?
to make the query dynamic.
The crosstab is not displayed!
Hans_vd
Hi Go Forward,
No error messages?
What happens when you remove the crosstab and just drag the dataset to the report layout, so that a table is created? Does it show any data then?
Go forward
When draging only the dataset to the report layout nothing is displayed, however the result is displayed
in my Edit Dataset !
Hans_vd
Mais qu'est ce qui se passe alors?<br />
<br />
Ok, try this:<br />
Create a data set without any parameters and with a very simple query like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>SELECT *
FROM tv_taxon_observe_commune</pre>
<br />
and try if you can get any data out of it on your report.
Go forward
Ok It works I had just a problem on accessing to my tables.
Thank's for help Hans_vd
Merci