
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF condition, checking number between two values
Hello everyone,
I am quite new in QlikView developing and I find a difficult to write an "If" statement. Now may statement is like
if(today() - "due_date" >='1' and today() - "due_date" <='30', "OpenAmount", '0') as [AR1-30]
But it has error. Can anyone suggest me how to write this sentence? I would like to check if today - due_date is in interval between 1 and 30 and if belongs to this I would like assign OpenAmount as [AR1-30]. Thank you in advance.
- Tags:
- new_to_qlikview


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried:
if((today() - "due_date")>='1' and (today() - "due_date")<='30', "OpenAmount", '0') as [AR1-30]
Maybe it is because of the parenthesys missing and the expression wasn't ok
I hope it helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There shouldn't be single quotes around the numbers.
talk is cheap, supply exceeds demand

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
you can use Interval funciont:
if(interval(today()- due_date, 'd')>=1 and interval(today()- due_date, 'd')<=30, OpenAmount, 0) as Field
KR,
Elena


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello I guess you try to find if a date is between day 1 and day 30, so try with:
if(day(today()) - due_date >=1 and day(today()) - due_date <=30, OpenAmount, 0) as [AR1-30]
Let me Know if this help you
