Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I load following data first
Vehicle_No Value
1 50000
2 100000
3 75000
4 125000
5 200000
Then I through a Join load the YEAR_OF_MAKE of some vehicle. Finally my data look as follows
Vehicle_No Value Year_of_Make
1 50000 2011
2 100000
3 75000 2013
4 125000 2014
5 200000
Now I want classify the year of make as follows in the load script
YOM
2011
2013
2014
Others (where there is no year of Make)
Kindly help me to write the script for this
NewTable:
load
Vehicle_No,
Value
if(len(trim(Year_of_Make))>0, Year_of_Make, 'Others') as YOM
resident
OldTable;
drop table OldTable;
Try like:
Load
If(Len(Year_of_Make)<>0, Year_of_Make, 'Others') AS YOM,
......
From <>;
Hi,
You could also use Is Null function in load script where Qlikview will load null fields as Others.
thanx
ALT(Year_Of_Make,'Others') as YOM
Hi Upali,
Try this:
Load
If(Len(trim(Year_of_Make))<>0, Year_of_Make, 'Others') AS YOM,
from ...<>
You can try this also:
if(isnull(Year_of_Make)=-1,'Others',Year_of_Make)
Regards
KC
NewTable:
load
Vehicle_No,
Value
if(len(trim(Year_of_Make))>0, Year_of_Make, 'Others') as YOM
resident
OldTable;
drop table OldTable;
you can add in the beginning of your script:
set NullValue='Others';
TKS ALL