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
Not applicable
Author

LOAD Area,
          Revenue,

          Disease,

          if(Disease='A' OR Disease='B','Disease',

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

FROM xyz.xlsx

This should be it!

Greetings,

Lucas

sundarakumar
Specialist II
Specialist II

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

then u have to resident load and group by disease and use sum(revenue).

-Sundar

Not applicable
Author

It is working with:

if(Disease='AML' OR Disease='CLL','Others',Disease) as Disease.

Thanks a lot everyone

Not applicable
Author

LOAD
    
Area,
    
Revenue,
    
if(Disease='A','A',
         
if(Disease='B','B',
              
if(Disease='C' OR Disease='D','Others'))) as Disease
FROM
Ex.xlsx
(
ooxml, embedded labels, table is Sheet1, filters(
Remove(Row, Pos(Top, 10)),
Remove(Row, Pos(Top, 9)),
Remove(Row, Pos(Top, 8)),
Remove(Row, Pos(Top, 7)),
Remove(Row, Pos(Top, 6))
));


I tried this, and it works

Greetings,

Lucas

Not applicable
Author

no problem, that's what we're here for

aveeeeeee7en
Specialist III
Specialist III


Hi Aakansha

Try this code:

LOAD if(WildMatch(Disease,'C','D'),'Others',Disease) AS Disease,
   
if(WildMatch(Disease,'C','D'),'',Area) AS Area,
   
Sum(Revenue) AS Revenue
FROM
[..\Example.xlsx]
(
ooxml, embedded labels, table is Sheet1) Group By Disease,Area;

This will probably fix your issue.

Further see the Attachment.

Regards

Aviral Nag