Qlik Community

Qlik Community Help Discussions

Discussion board for questions on how to use Qlik Community and its features.

Not applicable

How can i know if a field contains only numeric values ?

I have a problem: i must know if a alphanumeric field contains only numeric value or not.

Please help me

Thanks

Claudio

1 Solution

Accepted Solutions
Not applicable

Re: How can i know if a field contains only numeric values ?

Hi,

You can use the below script in script level or in Chart.

1. if(Isnum(FieldName),'Num','Text')

or

2. if(IsText(FieldName),'Text','Num')

Regards,

Joshmi

6 Replies

Re: How can i know if a field contains only numeric values ?

Add a Statistics Box object for the field and add the Numeric Count and Text Count statistics. Then check those counts.

hrlinder
Honored Contributor

Re: How can i know if a field contains only numeric values ?

try to work with purgechar

you may convert your field to upper case string

if (purgechar(yourstring,'0123456789ABCDEF')='',1,0)

1: only alphanumeric

0: other characters

sriharsha96
Contributor II

Re: How can i know if a field contains only numeric values ?

Hi try this

IsNum( expr )

Returns -1 (true) if the expression can be interpreted as a number, otherwise 0 (false).

Regards

Harsha

Not applicable

Re: How can i know if a field contains only numeric values ?

Hi,

You can use the below script in script level or in Chart.

1. if(Isnum(FieldName),'Num','Text')

or

2. if(IsText(FieldName),'Text','Num')

Regards,

Joshmi

Not applicable

Re: How can i know if a field contains only numeric values ?

Ok, I use the first:

=IF (IsNum( Warehouse_Map.DS_COLUMN),right('000' & Warehouse_Map.DS_COLUMN,3),Warehouse_Map.DS_COLUMN)

Thanks,

Claudio

Not applicable

Re: How can i know if a field contains only numeric values ?

Hi Claudio,

Could you close this discussion , if you find the same as helpful  or correct.

Regards,

Joshmi