
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IsNull function not working in script
Hi Friends,
I am having a Issue with Isnulll function. Some of expert can please help me to resolve this Issue
I am having field called Date.I want to show 0 when there is no Date got selected.
In front end side I am using formula in Text Object if(Isnull(Dates) = -1,0,1) we expected output 0. It's getting as expected.
I have written Same formula in script
Test:
LOAD
Dates,
if(IsNull(Dates)=-1,0,1) as [Date Info]
FROM
xyz.qvw
but [Date Info] is displaying only 1. Not even 0. Just like in below Screen shot
Some can plz help on this. I am attaching sample data and sample qvw
Thank you,
Swarupaaa
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the attached sample, there are no places where date is null. Have you tried adding a row where date is actually null?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i mean the correct code will be:
if(IsNull(Dates),0,1) as [Date Info]


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try it with: if(len(trim(Dates))=0,0,1) as [Date Info]
- Marcus


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if you are trying to display 1 if a value is selected in the Dates field and 0 if there's no value selected you can add a text object with the following formula:
=IF(GetSelectedCount("Dates")>0,1,0)
You don't need to apply that logic in the script.
Please let me know ir this helps.
Kind regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I added few nulls in your attached Excel file
I see 0
For your actual application, you might have white spaces and that's why IsNull isn't working. Try with Len(Trim()) function
If(Len(Trim(Dates)) > 0, 1, 0) as [Date Info]

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunny,
Is it possible by using len function?. why because my requirement is
if(Dates = "",0,1) so I thought it can be done by using Isnull. Is there any alternate method
Thank you,
Swarupaa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marcus,
Thanks for Reply. I have tried this but it's not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunny,
Thank you so much for Answer. But in my data there is null values. only if we select only it have to show 1.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Swarup,
check this : Show date Dates with 0 value if data not available

- « Previous Replies
-
- 1
- 2
- Next Replies »