question

ewinkiser avatar image
0 Votes"
ewinkiser asked NandanHegde-7720 commented

ADF Expression @lessorequals question?

Hi @nasreen-akter

I have the expression in my If Condition:

@lessorequals(int(item().virtualWorkPercentage), 0)

Without notice, I found out that the 0 can also be a NULL; how can I handle both?

Thanks!
Mike Kiser

azure-data-factory
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Hi @ewinkiser,

We still have not heard back from you. Just wanted to check if the below suggestion from Nandan was helpful? If it answers your query, please do click “Accept Answer” and/or Up-Vote, as it might be beneficial to other community members reading this thread.

And, if you have any further query do let us know.

0 Votes 0 ·

1 Answer

NandanHegde-7720 avatar image
0 Votes"
NandanHegde-7720 answered NandanHegde-7720 commented

Hey,
You can use the below expression
equals(coalesce(item(). Virtualworkpercantage, ' '), ' ') to check whether the value is null and based on your requirement do the needful in your if condition. Is your ask to make null values as zero?

Solution:

@lessorequals(int(coalesce(item().virtualWorkPercentage,0)), 0)

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hey @NandanHegde-7720

Thanks so much; I wasn't clear.

I need to be able to accept either NULL or 0 (zero); the data from the source comes in a either one.

I appreciate your help!

Thanks!
Mike

0 Votes 0 ·

So just to clarify, your ask is the column may contain zero or null value?
And in case if the column contains null, we treat it as zero.
Is my understanding correct?

1 Vote 1 ·
NandanHegde-7720 avatar image NandanHegde-7720 GajananHegdeNandan-4189 ·

@lessorequals(int(coalesce(item().virtualWorkPercentage,0)), 0)

1 Vote 1 ·
ewinkiser avatar image ewinkiser GajananHegdeNandan-4189 ·

Yes, exactly! Thanks!! @GajananHegdeNandan-4189

0 Votes 0 ·
Show more comments