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: 
mercadante
Creator
Creator

Valores Nulos no SetAnalyses

Sr(as). Boa tarde!

Alguém sabe dizer o que esta de errado neste set analysis?

=count({$<Identificador = {'C'},DATA_HABILITACAO_PONTO = {''}, DATA_PEDIDO_CANC_PONTO = - {''}, DATA_CANCELAMENTO_PONTO = - {''} >} Identificador)

O Problema esta com DATA_HABILITACAO_PONTO = {''}, ele não esta reconhecendo o campo como nulo.

Para garantir que o campo seja nulo inclui a seguinte condição na carga do painel

if(isnull(DATA_HABILITACAO_PONTO),NULL(),DATA_HABILITACAO_PONTO)

Mesmo assim não funcionou.

Se eu trocar o null por qualquer outro campo funciona, porem é inviável pois utilizo esse campo em vários cálculos. Teria que alterar um por um.

Obrigado!

1 Solution

Accepted Solutions
fernando_tonial
Partner - Specialist
Partner - Specialist

Olá Antonio,

O problema de trabalhar com nulo é que você não consegue selecionar o valor no QlikView e como você esta utilizando o Set Analysis fica mais complicado, pois o Set Analysis é similar a uma seleção em um determinado campo e assim como você não pode selecionar o nulo o Ser Analysis também não consegue.

Recomendo você criar um campo Flag para cada umas das datas.

if(isnull(DATA_HABILITACAO_PONTO),1,0) AS _Flag_Nulo_DATA_HABILITACAO_PONTO

if(isnull(DATA_PEDIDO_CANC_PONTO),1,0) AS _Flag_Nulo_DATA_PEDIDO_CANC_PONTO

if(isnull(DATA_CANCELAMENTO_PONTO),1,0) AS _Flag_Nulo_DATA_CANCELAMENTO_PONTO


faça a expressão assim:


=count({$<Identificador = {'C'},_Flag_Nulo_DATA_HABILITACAO_PONTO= {1}, _Flag_Nulo_DATA_PEDIDO_CANC_PONTO= {0}, _Flag_Nulo_DATA_CANCELAMENTO_PONTO= {0} >} Identificador)


Qlikfique-se.

Tonial.

Don't Worry, be Qlik.

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

I think that DATA_HABILITACAO_PONTO is a dimension so togheter with

if(isnull(DATA_HABILITACAO_PONTO),NULL(),DATA_HABILITACAO_PONTO)


you have to check (in the dimension page) the box "suppress when value is null"


Set analysis cannot manage null values but you are garanted that null do not exists by the upper condition


Let me know

MK_QSL
MVP
MVP

Mude o seu script como abaixo

Temp:

CARGA Identificador ,

     Se ( IsNull ( DATA_HABILITACAO_PONTO ) , nulo ( ) , DATA_HABILITACAO_PONTO ) como DATA_HABILITACAO_PONTO ,

     Se ( IsNull ( DATA_PEDIDO_CANC_PONTO ) , nulo ( ) , DATA_PEDIDO_CANC_PONTO ) como DATA_PEDIDO_CANC_PONTO ,

     Se ( IsNull ( DATA_CANCELAMENTO_PONTO ) , nulo ( ) , DATA_CANCELAMENTO_PONTO ) como DATA_CANCELAMENTO_PONTO

DE

[ Fórmula - Help.xlsx ]

( OOXML , rótulos embutidos , mesa é Sheet1 );

Now use

=COUNT({<Identificador = {'A'}, DATA_HABILITACAO_PONTO = {'*'}, DATA_CANCELAMENTO_PONTO = {"=Not IsNull(DATA_CANCELAMENTO_PONTO)"}, DATA_PEDIDO_CANC_PONTO = {"=Not IsNull(DATA_PEDIDO_CANC_PONTO)"}>}Identificador)

===================

Change your script as below

Temp:

LOAD Identificador,

     If(IsNull(DATA_HABILITACAO_PONTO),Null(),DATA_HABILITACAO_PONTO) as DATA_HABILITACAO_PONTO,

     If(IsNull(DATA_PEDIDO_CANC_PONTO),Null(),DATA_PEDIDO_CANC_PONTO) as DATA_PEDIDO_CANC_PONTO,

     If(IsNull(DATA_CANCELAMENTO_PONTO),Null(),DATA_CANCELAMENTO_PONTO) as DATA_CANCELAMENTO_PONTO

FROM

[Formula-Help.xlsx]

(ooxml, embedded labels, table is Sheet1);

use below expression

=COUNT({<Identificador = {'A'}, DATA_HABILITACAO_PONTO = {'*'}, DATA_CANCELAMENTO_PONTO = {"=Not IsNull(DATA_CANCELAMENTO_PONTO)"}, DATA_PEDIDO_CANC_PONTO = {"=Not IsNull(DATA_PEDIDO_CANC_PONTO)"}>}Identificador)

fernando_tonial
Partner - Specialist
Partner - Specialist

Olá Antonio,

O problema de trabalhar com nulo é que você não consegue selecionar o valor no QlikView e como você esta utilizando o Set Analysis fica mais complicado, pois o Set Analysis é similar a uma seleção em um determinado campo e assim como você não pode selecionar o nulo o Ser Analysis também não consegue.

Recomendo você criar um campo Flag para cada umas das datas.

if(isnull(DATA_HABILITACAO_PONTO),1,0) AS _Flag_Nulo_DATA_HABILITACAO_PONTO

if(isnull(DATA_PEDIDO_CANC_PONTO),1,0) AS _Flag_Nulo_DATA_PEDIDO_CANC_PONTO

if(isnull(DATA_CANCELAMENTO_PONTO),1,0) AS _Flag_Nulo_DATA_CANCELAMENTO_PONTO


faça a expressão assim:


=count({$<Identificador = {'C'},_Flag_Nulo_DATA_HABILITACAO_PONTO= {1}, _Flag_Nulo_DATA_PEDIDO_CANC_PONTO= {0}, _Flag_Nulo_DATA_CANCELAMENTO_PONTO= {0} >} Identificador)


Qlikfique-se.

Tonial.

Don't Worry, be Qlik.
mercadante
Creator
Creator
Author

Bom dia Alessandro!

Resolvi desta forma  if(isnull(DATA_HABILITACAO_PONTO),'-',DATA_HABILITACAO_PONTO)

Porem precisei alterar todos meus set analyses onde comparava a data como nulo para -

Obrigado pela ajuda!

mercadante
Creator
Creator
Author

Bom dia Fernando!

Consegui resolver alterando a carga para quando a Data_Habilitacao_ponto for nula preencha com '-'.

E posteriormente alterei o SetAnalyses para compara o '-'. Funcionou.

A forma com que você explicou também funcionaria perfeitamente.

Agora se você me permite gostaria de agradecer pelos posts que faz tanto aqui na comunidade quanto no seu Blog.

Sou novo nesta área e ainda tenho muitas dificuldades básicas, mas em quase 100% delas consigo resolver com alguma dica sua.

Obrigado por compartilhar seu conhecimento conosco!

Abraços!

fernando_tonial
Partner - Specialist
Partner - Specialist

Valeu Antonio, sempre que posso ajudo as pessoas.

Qlikfique-se.

Tonial.

Don't Worry, be Qlik.