Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help in the text box

Hi Friends,

Need help in the Text box object, the expression, as I trying to display if the "COD" has no value it should print "NIL".

But the following expression works but prints as "0", can you help me how to print as Nil if its 0

=If(Len(Trim([COD]=0)),Count({<[COD]={' '}>}[COD]),'Nil')

Regards

10 Replies
its_anandrjs

TRy like

=If(Len(Trim([COD])) = 0 ,Count({<[COD]={' '}>}[COD]),'Nil')


Regards

Anand

jyothish8807
Master II
Master II

Hi Try this:

=If(len(Trim([COD]))>0,count([COD]),'Nil')

Regards

KC

Best Regards,
KC
Not applicable
Author

Hi,

Thanks for your reply Anand Chouhan, but it still gives same result of 0 only.

Regards

its_anandrjs

Try with

=If(Len(Trim([COD])) >= 0 ,Count({<[COD]={' '}>}[COD]),'Nil')


Or


=If(Len(Trim([COD])) > 0 ,Count([COD]),'Nil')



PrashantSangle

Hi,

Try

Like

=Count(If(Len(Trim([COD]))=0,[COD]))

or

Count({<[COD]={"isnull(COD)"}>}[COD])

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
anbu1984
Master III
Master III

Replace ID with primary key from your table

=If(Len(Trim([COD]=0)),Count({<ID={'=Len(Trim([COD]))=0'}>}ID),'Nil')

Not applicable
Author

Hi,

Try this,

=if(isnull(COD),'Nil', COD)

Hope it will help.

Apurva

mjm
Employee
Employee

Vincent,

in my view it should simply be,

if(COD='','NIL', COD) as CODValue

Does this help. It simply evaluates if COD is an empty string or not

Please mark this as answered and complete if this is helpful

Not applicable
Author


Hi,

If(Len(Trim([COD])) = 0 ,'Nil') Or

Alt([COD], 'Nil')