Conceptuelmente resulta así:
Qlik script:
data: LOAD * INLINE [ ID, SUCURSAL, VENTA 1, norte, 33 2, ,99 3, sur, 11 , este, 22 5, norte, , oeste, 33]; campos_null: LOAD Null() as field_name AutoGenerate 0; let table_name = 'data'; let CantCampos=NoOfFields('$(table_name)'); for i=1 to CantCampos
let field_n = FieldName(i,'$(table_name)'); temp2: LOAD * Where $(field_n) = 1; LOAD if(len($(field_n))=0 or IsNull($(field_n)), 1, 0) as $(field_n) Resident $(table_name); let row_n = NoOfRows('temp2'); if row_n > 0 THEN Concatenate(campos_null) LOAD '$(field_n)' as field_name, '$(row_n)' as qty_null AutoGenerate 1;
END IF DROP Table temp2; NEXT i
No hay comentarios:
Publicar un comentario