Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Jsobrinho77
Creator
Creator

If expression returning null

Hi guys,

I have an if dimension expression that returns the values and null, how solve this?

expression like that:

if( fieldA = 1,

text(aggr(concat({<FieldC={*}>}distinct FieldB,','),FieldC),

FieldD)

The result in the table is the values and a null row.

Labels (5)
1 Solution

Accepted Solutions
Benoit_C
Support
Support

Hi @Jsobrinho77,

You could try to add a condition in your expression that filters out the null values. For example:

if( fieldA = 1 and not isnull(FieldB),

text(aggr(concat({<FieldC={*}>}distinct FieldB,‘,’),FieldC),

FieldD)

This should remove the null row from your table. 

Regards,

Benoit

View solution in original post

3 Replies
E_Røse
Creator II
Creator II

I am not sure exactly what is the problem, can you explain a bit more?

See if it helps to add the nodistinct keyword within the aggr-function.

Please like and mark my answer as a solution, if it resolved your issue.

E. Røse
Senior Analytics Consultant, Atea Norge
Benoit_C
Support
Support

Hi @Jsobrinho77,

You could try to add a condition in your expression that filters out the null values. For example:

if( fieldA = 1 and not isnull(FieldB),

text(aggr(concat({<FieldC={*}>}distinct FieldB,‘,’),FieldC),

FieldD)

This should remove the null row from your table. 

Regards,

Benoit

BrunPierre
Master
Master

Perhaps as below with double quotes?

if( fieldA = 1,

text(aggr(concat({<FieldC={"*"}>}distinct FieldB,','),FieldC),

FieldD)