Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
i had a question
i had a table like that:
Client2013 Client2014 Client2015
QUICK - Mcdo
Flunch KFC QUICK
Eli - -
Elo Youk -
Mcdo - QUICK
i'd like to have a new column with conditions if there is somthing in client 2014 replace in client2013 and if exists client2015 replace client2014(with replace client2013 if exist)
to resume, the result should be:
NvClients
Mcdo
QUICK
Eli
Youk
QUICK
how can i do? THANKS a lot and sorry for my bad english
load
Client2013,
Client2014,
Client2015,
if(len(trim(Client2015)),Client2015,
if(len(trim(Client2014)),Client2014,Client2013)) as NvClients
from ...
thanks a lot but just a problem,
When Client2014 and Client 2015 not exists (Client2013 always exists) the result is "-" but i want Client2013
Exemple:
Client2013 Client2014 Client2015
Eli - -
With your script that give me "-" but i want "Eli" for the rest this is perfect! thanks
Try:
load
Client2013,
Client2014,
Client2015,
if(len(trim(Client2015)) and Client2015 <> '-',Client2015,
if(len(trim(Client2014)) and Client2014 <> '-',Client2014,Client2013)) as NvClients
from...
Okay i understand the problem
when the name is too long because i had 1000 names, thats not put it in nvclient, may be beccause of len?
Could be. You can try the IsNull function instead of len(trim(...)).
OKAY i gat the solution, i delete "len" and its ok! thank you very much!!!
Arf sorry but it's not ok xD
LOAD [Client2013 ],
Client2014,
Client2015,
if(len(trim(Client2015))=0,Client2014,if(len(trim(Client2014)=0),[Client2013 ])) as NvClients
use this may help you.
LOAD * Inline [
Client2013 , Client2014 , Client2015
QUICK , - , Mcdo
Flunch , KFC , QUICK
Eli , - , -
Elo , Youk , -
Mcdo , - , QUICK
];
LOAD
if(Client2015<>'-',Client2015,
if( Client2015='-',if( Client2014='-',Client2013,Client2014),Client2014)) as nta
Resident tab;