Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AH
Creator III
Creator III

Understanding Script

Hi,

I have a code in my script like this that somebody has written previously:

If(Sales> '0' or [Sales Flag] = 'Y', 'Y', 'N') as WarrantFlag

What is this code mean?

Is it like this? if sales is greater than zero or Sales flag = Y then Y otherwise N.

If i want to us these piece of code in where clause after the load statement then how should i write the code?

Thanks,

ahmed100

1 Solution

Accepted Solutions
kkkumar82
Specialist III
Specialist III

I think load  .... ......     where (sales>0 or  flag='yes');  is also fine  Kiran Kumar

View solution in original post

12 Replies
Chanty4u
MVP
MVP

hi,

the code mens

If(sales>0

or

[sales flag]= 'yes'    the value of sales is more than " 0"  or sales flag value  is "yes"  it will returns " yes"  otherwise "No"   by that it will create a flag.

hope this helps u

AH
Creator III
Creator III
Author

Hi Chanty,

Thanks for the reply.

How can i use this code in where clause in the load script?

like this:

Load

---,

---

From xyx

Where-----------(how to use the code here?)

Thanks,

ahmed100

Chanty4u
MVP
MVP

load *,

....

......

where exists (sales>0 and/or  flag='yes');

kkkumar82
Specialist III
Specialist III

I think load  .... ......     where (sales>0 or  flag='yes');  is also fine  Kiran Kumar

AH
Creator III
Creator III
Author

Hi Chantu,

Is the exists functions is used when there is a table Already loaded and we are comparing the table we are currently loading?

Thanks,

ahmed100

kkkumar82
Specialist III
Specialist III

Hi Ahmed,

Your are correct exists function is used to check if the value exists for previous loaded values, Is that what you want or while loading you want to check the condition then what I suggested would be fine.

Regards

Kiran Kumar

Kushal_Chawda

try this

WHERE Sales>0 or [Sales Flag]='Y'

Chanty4u
MVP
MVP

yes..

u can try

where sales>0 and [sales flag]='yes'

jagan
Luminary Alumni
Luminary Alumni

HI,

If you want to filter out those rows then use below script

Data:

LOAD

*

FROM DataSource

WHERE Sales> '0' or [Sales Flag] = 'Y';


Regards,

jagan.