Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there
I currently have the following within my script to load a qvd file :
if(CT_YEAR = 'C', 2010, if(CT_YEAR = 'L', 2009)) as [ACYear],
I'd like to cater for another option 'N' :
if CT_YEAR = 'C' then
ACYear = '2010'
elseif CT_YEAR = 'L' then
ACYear='2009'
elseif CT_YEAR = 'N' then
ACYear ='2011'
endif
Can anyone advise how to set this up within the load script?
Thanks
Bob
if(CT_YEAR = 'C','2010',if(CT_YEAR = 'L','2009',if(CT_YEAR = 'N','2011'))) as ACYear,
please try the above script .
if(CT_YEAR = 'C','2010',if(CT_YEAR = 'L','2009',if(CT_YEAR = 'N','2011'))) as ACYear,
please try the above script .
Try
If
9999 is the catchall error
(CT_YEAR = 'C', '2010', If (CT_YEAR = 'L','2009', If (CT_YEAR = 'N','2011', '9999'))) As ACYear,I may be missing somehting but the way I'd do the above is:
=if(CT_YEAR = 'C','2010',if(CT_YEAR = 'L','2009',if(CT_YEAR = 'N','2011','Outside Range'))) as ACYear,
Just like a running IF expression in Excel.
Alternatively look into using a Mapping load and 'Apply Map' in the script.
Hope that helps,
Matt - Visual Analytics Ltd
Hi
I tried the solution given by priyadashin and it worked fine. Thanks to everyone who replied.
Bob