Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Black_Hole
Contributor II

Problem with IF statement in Load

Hello all,

In my script, I write an IF statement and I save the result in a new column.

But I don't understand why after to run the script I get none value for the column created.

  • Below my script:

AMOUNT:
LOAD *,
IF(LEN(Type)=0,Credit,Debit) as test
RESIDENT JOURNAL;

  • Below the result:

00.PNG

Please could you help me to resolve this problem.

Thank you in advance for your help.

Labels (4)
4 Replies
neelamsaroha157
Valued Contributor II

Re: Problem with IF statement in Load

Can you add a new column as  LEN(Type) just to check the values you for the newly added column.

Highlighted
Support
Support

Re: Problem with IF statement in Load

Only other thing that came to mind for me was if you aliased Type in the original load statement and are using the original field name not the alias?  Highly unlikely, but I wanted to toss it out there just in case.

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
nicolas66
New Contributor III

Re: Problem with IF statement in Load

Bonjour,

If(LEN('Type')=0, 'Credit', 'Debit') as test 

... perhaps ?

Berndtssono
New Contributor

Re: Problem with IF statement in Load

if(len(Type)='0', Credit, Debit) as test

maybe like that