Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

rathnam_qv
Contributor

Nuul as Others

Hi All,

I have two fields one is coming from database and the second one coming from Excel. Joining these two using code and pulling these two fields into Table. For field1 there are few nulls in field2.

I want to assign those nulls as Others in the field2. How to achieve it?

PFA image.

Thanks,

Rathnam.

8 Replies
Ivan_Bozov
Valued Contributor

Re: Nuul as Others

Hello! Perhaps something like: If(IsNull('Field2'),'Others','Field2')

rathnam_qv
Contributor

Re: Nuul as Others

Hi Ivan,

Thanks for your Time.

I tried that but not working.

Thanks,

Rathnam.

sasiparupudi1
Honored Contributor III

Re: Nuul as Others

Try

If(Len(trim(('Field2'))=0,'Others','Field2')


or post some sample data or a sample app


hth

Sasi

Ivan_Bozov
Valued Contributor

Re: Nuul as Others

Okay, I just checked and it works if the tables are joined in the script. Small example below:

Script:

Example:

Load

Supplier,

Country

Inline

[Supplier,Country

A,China

B,Japan]

(Delimiter is ',');

Outer Join Load

Supplier,

Code

Inline

[Supplier,Code

A,CN]

(Delimiter is ',');

Sheet:

Table.PNG

Not applicable

Re: Nuul as Others

Hi Rathnam,

If you use these two tables auto link together, like this:

2017-08-11_161415.png

Then you can try the following expressions, these two both work effectively.

if(aggr(isnull(Field_B),Field_A),'Other',Field_B)

or

if(aggr(len(Field_B),Field_A)=0,'Other',Field_B)

2017-08-11_161614.png

Regards,

Nina

rathnam_qv
Contributor

Re: Nuul as Others

Hi Nina,

Thank you very much.

This is Exactly working as i expected. To give Correct Answer i am not seeing that option in Actions so, i gave Helpful.

Thank u once again.

Rathnam,

sureshqv
Esteemed Contributor III

Re: Nuul as Others

try this in dim

if(IsNull(filed),Dim)

Not applicable

Re: Nuul as Others

Hi Rathnam,


My pleasure!


Nina

Community Browser