Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
lucky1618
Contributor
Contributor

Facing problem in screpting

hi all

i need  a answer for this,

i am loading three fields from qvd , one of the field having both numeric and char but i want to display only numeric values .

LOAD [SHIP REGISTERED IN],
[VESSEL NAME],
[Container Number]

this is my fields and  [Container Number] i want to display this field .

2 Solutions

Accepted Solutions
Miguel_Angel_Baeyens

  • Do you want to clean up the field from non-numeric values?

Use KeepChar([Container Number], '0123456789')

  • Do you want instead to only load those records for which the value of [Container Number] is numeric only? Do

LOAD ...

FROM...

WHERE IsNum([Container Number])

  • Do you want to load all data but only display in a listbox or a chart those rows for which [Container Number] is numeric?

Create a new field in the script for that

LOAD ...

If(IsNum([Container Number]), [Container Number], Null()) AS [Container Numeric Only]

...

View solution in original post

Miguel_Angel_Baeyens

LOAD *,

KeepChar([Container Number], '0123456789') AS [Container Number Only]

FROM ...

 

Note that this will create a new field with only the numeric values from [Container Number], so in your examples, this field will store "226073" and "606255".

View solution in original post

4 Replies
Miguel_Angel_Baeyens

  • Do you want to clean up the field from non-numeric values?

Use KeepChar([Container Number], '0123456789')

  • Do you want instead to only load those records for which the value of [Container Number] is numeric only? Do

LOAD ...

FROM...

WHERE IsNum([Container Number])

  • Do you want to load all data but only display in a listbox or a chart those rows for which [Container Number] is numeric?

Create a new field in the script for that

LOAD ...

If(IsNum([Container Number]), [Container Number], Null()) AS [Container Numeric Only]

...

lucky1618
Contributor
Contributor
Author

Hi Miguel,

thanks for your support ,but still i did not get the answer,  please check my code once .  [Container Number] values  are like this  TGHU226073 ,LTIU606255


i want to display only numeric values.

//load * where [Container Number]= KeepChar([Container Number],'0123456789');
LOAD [SHIP REGISTERED IN],
[VESSEL NAME],
[Container Number]
//iF(IsNum([Container Number]),[Container Number],null()) as number
FROM
[C:\Users\srinivasu\Desktop\Qlikview files\Folder Structure\FDS\Extract_QVD\Shiprereg.qvd]
(qvd)
Where IsNum([Container Number]);

Miguel_Angel_Baeyens

LOAD *,

KeepChar([Container Number], '0123456789') AS [Container Number Only]

FROM ...

 

Note that this will create a new field with only the numeric values from [Container Number], so in your examples, this field will store "226073" and "606255".

lucky1618
Contributor
Contributor
Author

Thank u Miguel i got answer.