Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I think load .... ...... where (sales>0 or flag='yes'); is also fine Kiran Kumar
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
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
load *,
....
......
where exists (sales>0 and/or flag='yes');
I think load .... ...... where (sales>0 or flag='yes'); is also fine Kiran Kumar
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
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
try this
WHERE Sales>0 or [Sales Flag]='Y'
yes..
u can try
where sales>0 and [sales flag]='yes'
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.