Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
DestinedTale
Contributor II
Contributor II

[Load Script] If Field A is 0 then Field B is 0

Hi, I would like another field value to change to 0 based on the first field. Something like this

If amount due is less than 0 then field B will be 0 then with another if condition

 if([A] < 0, [A]) as [B], second condition 

Labels (2)
3 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

If([amount due] < 0, 0, If(A < 0, A, ':')) as B

This should do the job.

 

prieper
Master II
Master II

if([A] < 0, [A], second condition) as [B]
should do
nilaksh92
Partner - Contributor III
Partner - Contributor III

I think the below syntax might work

 

load

A,

if(A<0,0,if(A>0,Value/Field,DefaultValue)) as B

From xyz

 

Do let me know if this answers your query?