Discussion board where members can get started with QlikView.
New to Qlikview so please bear with me. As an example of what I'm after, say I have the following fields in my data:
Where there is an entry in Change_Station I want to use this field. If there isn't any data in that field I want to use On_station. I've tried:
if(Change_Station=''',On_Station,Change_Station) as BoardingStation
This only brings across the BoardingStation where data is in the Change_Station field. No doubt I'm making a basic mistake here but any help would be appreciated.
Go to Solution.
It seems right at first, although your quotes could be the result of a different encoding on your side.
And to make sure the field Change_Station is really empty, you could try this to check if it's empty or if it contains data.
The below code will obviosly give you a new field called BoardingStation containing either On_Station or Change_Station.
if(len(trim(Change_Station)) = 0, On_Station, Change_Station) as BoardingStation
if(len(trim(Change_Station)) >= 1, Change_Station, On_Station) as BoardingStation
if(trim(Change_Station) = '', On_Station, Change_Station) as BoardingStation
BI Architect Consultant
Framsteg Business Intelligence Corp.
=if(Change_Station='',On_Station,Change_Station) .. you are using double quotes, it should be single quotes
if( len(trim(Change_Station))=0,On_Station,Change_Station) as BoardingStation
Thanks to all replies and the quick response.
The second method worked using the >=1