Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jorge_redondo
Contributor III
Contributor III

Reemplazar valor de campo en función a otro valor

Hola!

Tengo este script de carga:

ODBC CONNECT TO [MS Access Database;DBQ=C:\Contasol\Datos\1002013.MDB];

BMS2013:

LOAD

    Date(FECAPU,'DD/MM/YY') as Fecha,

    ASIAPU as Asiento,

    CUEAPU as Cuenta,

    CONAPU as Concepto,

    CIVAPU as [Registro IVA];

   

    SQL SELECT * FROM F_APU WHERE TIVAPU<>'R';

La tabla quedaría tal que así:

QlikView Personal Edition - [CQlikviewListadoIVA.jpg

Cada asiento puede incluir un nº de registro de IVA (o no). En caso de que lo incluyese, desearía sustituir el '0' por el nº en cuestión. Es decir, en el caso de la imagen, en el asiento nº 1, quisiera que los 3 registros del asiento contuviesen el valor 17. Pero si mas adelante se encontrara con el asiento nº XX que no contuviese ningún valor >0 (no incluido en el libro de IVA), dejarlo como está.

¿Cómo podría conseguir esto durante la carga? Muchas gracias!!

2 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If I have understood you need the value ob Registro IVA beeing assigned to the others "Concepto"; If this is your goal then

MYTAB:

LOAD

    Date(FECAPU,'DD/MM/YY') as Fecha,

    ASIAPU as Asiento,

    CUEAPU as Cuenta,

    CONAPU as Concepto,

    CIVAPU as [Registro IVA];

  

    SQL SELECT * FROM F_APU WHERE TIVAPU<>'R';

left join

Load

     Concepto,

     max(registro iva) as my_registro

resident MYTAB

group by concepto

In this way each row will contain a new column my_registro containing the value you need

Hope it helps

jorge_redondo
Contributor III
Contributor III
Author

Hi!

Thanks for your help, but it shows an error "FIELD NOT FOUND Concepto"

ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Contasol\Datos\1002013.MDB];


BMS2013:

LOAD

Date(FECAPU,'DD/MM/YY') as Fecha,

ASIAPU as Asiento,     

CUEAPU as Cuenta,     

CONAPU as Concepto,     

CIVAPU as [Registro IVA];          

SQL SELECT * FROM F_APU WHERE TIVAPU<>'R';  

Left Join Load Concepto

max([Registro IVA]) as my_registro

resident BMS2013 

group by Concepto