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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Compare two column values and create a new column

I have two columns with years 2014 and 2015.

The values present in Column 2014 may or may not be present in 2015.

I have to create a column where

If the value is present only in 2014, then the new column value must say 'Old'.

if the value is present only in 2015, then the new column value must say 'New'.

If the value is present in both the years, it must show 'Both' as Column values.

How do I get this done?

12 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Ok, you don't seem to quite know what a load statement is. Please work through the tutorial you can find at Tutorial ‒ QlikView. When you get to Chapter 3 of the pdf file make sure to follow the instruction on top op page 97:

>>Study the script<< (emphasis added by me).

In the LOAD statement, the fields of the selected file are listed. Some of the field

names are enclosed by square brackets. This is required when a field name contains spaces. The

FROM statement is followed by the path to the file.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi,

Can you please see the below output and let me know is this the one you are expecting? If yes, can you please see the attached script and if no, please provide the output you are expecting

Thanks,
Sreeman

Anonymous
Not applicable
Author

Hi Sreeman,

Thank you so much. More or less, yes. But the I should see only three columns : final_2014, final_2015 and the result column where it gives me 'New' 'Discarded' and 'Both' options. I was using conditions which should work fine but for some reason, they don't. I figured it out anyway. Thanks once again.