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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how can we merge values of a field in script level?

Hi,

How can we merge values of a field in script. For ex;

Disease

A

B

C

D

and here i want 2 values c & d to get merged into 1 value nd named as others?

Please help.

25 Replies
sundarakumar
Specialist II
Specialist II

I think this will help

load

area,

project,

if(disease='a' or disease='b', disease,null())as disease,

if(disease='c' or disease='d',disease , null())as others

from

xyz.xlsx;

-Sundar

Not applicable
Author

C & D are the values not the fields

It is like

Disease

A

B

C

D

and in script while loading:

load

Area,

Disease,

Project

from xyz.xlsx

and now i want to merge the values in disease.

aveeeeeee7en
Specialist III
Specialist III

See the Attached

Regards

Aviral Nag

Not applicable
Author

Hm, I think that will almost work, maybe this:

Temp:

LOAD Area,

          Project,

          Disease

FROM xyz.xlsx;

Real:

LOAD *,

          if(Disease='A' or Disease = 'B','Disease') as Others

          if(Disease='C' or Disease = 'D','Disease') as Others

Not applicable
Author

In this, others is coming as a separate field and Disease as separate but i want others to be included as a value.

aveeeeeee7en
Specialist III
Specialist III

What exactly you want. Explain your requirement on Excel.

Anonymous
Not applicable
Author

Hi Aakansha,

Please update sample file,so able to help

aveeeeeee7en
Specialist III
Specialist III

In the Attached I have provide you 2 Fields named as others & Others11:

Try this:

if(WildMatch(Disease,'C','D'),'Others',Disease) AS Others

Regards

Not applicable
Author

This is the requirement.

Not applicable
Author

I have tried this. but this creates one extra field others.

and i want others to be a value of disease as mentioned in Ex.xlsx