Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
aayenge2
Contributor
Contributor

Getting load to work with if and exists?

Hey folks.

I have a situation where I need to join a bunch of similar, but not identical, report files into a single.QVD. I've been renaming headers with python before loading but now my boss wants me to get rid of the python step and do it all in Qlik.

The issue is that it's a bunch of .CSV files with slightly different header names. For example "Customer #" vs "Customer number" vs "Client No." There's no option to get these to come in harmonized because they're from different vendors.

I was trying to do something like: Load Distinct If(exists('Customer #'), 'Customer #') as CustomerNumber If(exists('Client No.'), 'Client No.') as CustomerNumber

But I get an error about the headers not being unique even though I'd expect the If() to return nothing when the Exists() condition fails.

Moving the "as CustomerNumber" inside the If() statement is a syntax error.

Is there a way to do this without making temporary tables and conctenating? I'm now doing it this way and it's working but it seems inelegant and like it's more steps than should be needed.

Thanks!

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP