
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF statement
Hi,
Can you please help me out with the following IF statement?
If (ReceiptValueCurrency=0,Value,ReceiptValueCurrency)
I had a look in the database and when I want the field Value to show ReceiptValueCurrency should have no value at all (not even zero). How do I write this?
Thanks!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if(isnull(ReceiptValueCurrency) or len(trim(ReceiptValueCurrency)) = 0,Value,ReceiptValueCurrency)


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OR even below:
if( len(trim(ReceiptValueCurrency)) = 0, Value, ReceiptValueCurrency )
this works also if ReceiptValueCurrency field is empty.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please try If (len(ReceiptValueCurrency)=0,Value,ReceiptValueCurrency)
or
If (ReceiptValueCurrency=' ',Value,ReceiptValueCurrency)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used IF(len(ReceiptValueCurrency)=0,Value,ReceiptValueCurrency) and it worked, thank you!
Can you please explain what the function 'len' does to the statement?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
take a look at Len - script and chart function ‒ QlikView


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
len() used check length of your field value if there is no value means null then it will consider as 0.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello madeleine.josefsson‌ , our friends share with you the answer please feel free to mark the person as correct answer who give it first, then her is a resume of all possible answers :
If (len(ReceiptValueCurrency)=0,Value,ReceiptValueCurrency)
If (ReceiptValueCurrency=' ',Value,ReceiptValueCurrency)
if( len(trim(ReceiptValueCurrency)) = 0, Value, ReceiptValueCurrency )
if(isnull(ReceiptValueCurrency) = 0,Value,ReceiptValueCurrency)
and for function len() it calculate the value lenght of the field given between (), for further informations visit this link Len - script and chart function ‒ QlikView
