Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Buenos dias
Por favor su ayuda, al momento de elaborar el script me sale un error de referencia en los campos (mas de 2) que utilizo como referencia cruzada. O la sentencia esta bn desarrollada
Ejemplo
//D3LP
Directory;
Crosstable (v1, v2, ...) LOAD
enero,
febrero,
...
FROM
datos.qvd
(qvd);
Saludos,
David
Developer
Customer | Brand | Country | Jan | Feb | Mar | Apr |
AA | A | Germany | 100 | 200 | 133 | 160 |
BB | B | Poland | 120 | 140 | 98 | 100 |
CC | C | Italy | 100 | 200 | 133 | 160 |
DD | D | France | 200 | 600 | 300 | 165 |
Consider that you have table like above and you need to get table as below, we need to use crosstable functionality in QlikView Script...
Customer | Brand | Country | Month | Sales |
AA | A | Germany | Jan | 100 |
BB | B | Poland | Jan | 120 |
CC | C | Italy | Jan | 100 |
DD | D | France | Jan | 200 |
AA | A | Germany | Feb | 200 |
BB | B | Poland | Feb | 140 |
CC | C | Italy | Feb | 200 |
DD | D | France | Feb | 600 |
AA | A | Germany | Mar | 133 |
BB | B | Poland | Mar | 98 |
CC | C | Italy | Mar | 133 |
DD | D | France | Mar | 300 |
AA | A | Germany | Apr | 160 |
BB | B | Poland | Apr | 100 |
CC | C | Italy | Apr | 160 |
DD | D | France | Apr | 165 |
Sales:
CrossTable(Month, Sales, 3)
LOAD Customer,
Brand,
Country,
Jan,
Feb,
Mar,
Apr
FROM TableName;
Here 3 is for First Three Dimensions which are Customer, Brand and Country
If we have only two Dimensions from above three we need to use 2 instead of 3.
Hope this help.
Can you load your full script...
Crosstable should be like below...
CrossTable(Month,Sales, 2)
Load
CustomerName,
Country,
Jan,
Feb,
...
..
From TableName;
Directory;
Crosstable (v1, v2) LOAD
'Dummy' as Dummy
enero,
febrero,
...
FROM
datos.qvd
(qvd);
Drop Field Dummy;
No entiendo esta parte cruzado (Mes, Ventas, 2).
En el primer valor de Mes, se tiene el valor de los campos de dimension ?? si son mas dos que se hace (Yo tengo 4). El valor de ventas es el nombre de la referencia de la tabla Cruzada ??
Saludos,
David
Developer
Customer | Brand | Country | Jan | Feb | Mar | Apr |
AA | A | Germany | 100 | 200 | 133 | 160 |
BB | B | Poland | 120 | 140 | 98 | 100 |
CC | C | Italy | 100 | 200 | 133 | 160 |
DD | D | France | 200 | 600 | 300 | 165 |
Consider that you have table like above and you need to get table as below, we need to use crosstable functionality in QlikView Script...
Customer | Brand | Country | Month | Sales |
AA | A | Germany | Jan | 100 |
BB | B | Poland | Jan | 120 |
CC | C | Italy | Jan | 100 |
DD | D | France | Jan | 200 |
AA | A | Germany | Feb | 200 |
BB | B | Poland | Feb | 140 |
CC | C | Italy | Feb | 200 |
DD | D | France | Feb | 600 |
AA | A | Germany | Mar | 133 |
BB | B | Poland | Mar | 98 |
CC | C | Italy | Mar | 133 |
DD | D | France | Mar | 300 |
AA | A | Germany | Apr | 160 |
BB | B | Poland | Apr | 100 |
CC | C | Italy | Apr | 160 |
DD | D | France | Apr | 165 |
Sales:
CrossTable(Month, Sales, 3)
LOAD Customer,
Brand,
Country,
Jan,
Feb,
Mar,
Apr
FROM TableName;
Here 3 is for First Three Dimensions which are Customer, Brand and Country
If we have only two Dimensions from above three we need to use 2 instead of 3.
Hope this help.
Hola,
Solo para agregar a lo que ya han dicho,
la sintaxis de Crosstable toma 3 parámetros:
En tu ejemplo, las columnas con los nombres de los meses deben colocarse hasta el final y en tu caso necesitas un campo dummy, tal como lo puso Gysbert,
saludos
Muchas gracias a los dos. Todas las dudas quedaron aclaradas.
Saludos
David León
Developer
Dear David,
If you question resolved, please close this thread by choosing correct or helpful answer.
Thanks