Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I like to make a chart like this.
I use ID as Dimention and Measure, and the function:
=Aggr (If([COCHE={Coche}], Count[ID]/Count(total ID)), If([MOTO={Moto}], Count[ID]/Count(total ID)), If([VIDA={Vida}], Count[ID]/Count(total ID)), If([HOGAR={Hogar}], Count[ID]/Count(total ID)), If([<SALUD={Salud}>]), Count[ID]/Count(total ID)), If([ACCIDENTES={Accidentes}], Count[ID]/Count(total ID)), If([MOTO={Moto}]), Count[ID]/Count(total ID)), (Numeric, Descending))
The error I received is this:
May be I have to make a New dimention with fields: COCHE, MOTO, VIDA, HOGAR, SALUD, ACCIDENTES y MOTO. Pero no sé como hacerlo.
Hi,
It would make more sense to transform your data in the data load editor so that you have fields:
ID, PROVINCIA, TIPO DE SEGURO, CANTIDAD.
Here's how I did it using the CrossTable() function:-
[data_temp]:
Load * Inline [
ID PROVINCIA COCHE MOTO HOGAR SALUD DENTAL VIDA ACCIDENTES
2 , Barcelona , Coche , , Hogar , , , ,
3 , Zaragoza , , , Hogar , , , ,
5 , Madrid , Coche , Moto , , Salud , , ,
15 , Sevilla , Coche , , Hogar , Salud , , , Accidentes
16 , Madrid , , , Hogar , , Dental , ,
26 , A Coruña , Coche , , Hogar , , , ,
39 , Las Palmas , Coche , , , , , ,
40 , Madrid , Coche , Moto , Hogar , Salud , , ,
60 , Barcelona , , , Hogar , , , ,
62 , Madrid , Coche , , , , , ,
68 , Madrid , Coche , , Hogar , , , Vida ,
89 , Madrid , Coche , , Hogar , , , Vida ,
104 , Madrid , , , Hogar , , , ,
117 , Valencia , Coche , , Hogar , , Dental , , Accidentes
];
[unpivot]:
CrossTable ("Tipo de Seguro",Cantidad_Tmp,2)
Load
*
Resident [data_temp];
Drop table [data_temp];
Join
Load
ID,
PROVINCIA,
"Tipo de Seguro",
if(len(Cantidad_Tmp)>0,1,0) as "Cantidad"
Resident [unpivot];
qvd attached.
Thank you very much. I´ll try to make it in the data load editor.