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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script loading

Can I use the following script ?

Vente :

Load * ,

IF(comp is null , 'O',comp) as Comp


Resident TempVente;

drop table Vente;

7 Replies
gautik92
Specialist III
Specialist III

IF(Isnull(comp), 'O',comp) as Comp

flipside
Partner - Specialist II
Partner - Specialist II

If comp contains only numeric values, use the Alt function ...

Alt(comp,0) as Comp

.. otherwise use IsNull ...

If(IsNull(comp),'0',comp) as Comp

flipside

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try,

LOAD

*,

IF(ISNULL(Comp) OR LEN(Comp) = 0, 0, Comp)           AS  FieldName


Resident TempVente;

drop table Vente;

tamilarasu
Champion
Champion

Hi,


Another solution

Vente :

Load * ,

IF(Len(Trim(comp))>0, 0,comp) as Comp

Resident TempVente;

drop table TempVente;

Above script will work, even for blank cells.

scriptina.jpg

marcus_malinow
Partner - Specialist III
Partner - Specialist III

surely you want to change your DROP statement to:

drop table TempVente;

sunny_talwar

I would reverse the order of true and false here

If(Len(Trim(comp)) > 0, comp, 0) as Comp

tamilarasu
Champion
Champion

My mistake