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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Create a new field from 2 fields in the load scrip with the data limited?

Hi

I want to create a new field in my script from 2 other fields but i also want to limit the data .

i.e.

DealNumber

DealName

I want to combine these 2 fields which is easy enough:

DealNumber & '-' & DealName AS [Deal Description],

I only want it to show DealNumber >=200050 and DealNumber <=200020 or DealNumber =900000 and call it [Meal Deals]

Can anyone please tell me how i would write this into the script?

Thanks

1 Solution

Accepted Solutions
Not applicable

You can add an IF statement while generating the new column [Deal Description]

IF((DealNumber>=200050 and DealNumber<=200020) OR DealNumber=900000,DealNumber & '-' & DealName) as [Deal Description]

Hope this healps.

View solution in original post

4 Replies
volcore79
Partner - Contributor III
Partner - Contributor III

Could you send an example file ?

Not applicable

You can add an IF statement while generating the new column [Deal Description]

IF((DealNumber>=200050 and DealNumber<=200020) OR DealNumber=900000,DealNumber & '-' & DealName) as [Deal Description]

Hope this healps.

bismart
Creator
Creator

Think your selection criteria is wrong...

DealNumber cannot be >= 200050 and <= 200020

your code : DealNumber>=200050 and DealNumber<=200020 OR DealNumber=900000

Otherwise

Load

DealNumber & '-' DealName as [Deal Description]

from Tablename

where

DealNumber >= 200020 and DealNumber <=200050

OR DealNumber = 900000;

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks Muralidhar, that worked great. Thanks.