Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Several fields to one

Hi community,

I have a table with several of fields. Some of them I would like to group to one field and then use it as av filter. I have tried with below:

LOAD ID,

     HO,

     HOKO,

     NA,

     VA,

     RI,

     HY,

     HYSK,

     HYMO,

      if(HO = '1', 'HO',

           if(HOKO = '1', 'HOKO',

                if(NA = '1', 'NA',

                     if(VA = '1', 'VA',

                          if(RI = '1', 'RI',

                               if(HY = '1', 'HY',

                                    if(HYSK = '1', 'HYSK',

                                         if(HYMO = '1', 'HYMO',

                                              if(HP = '1', 'HP '))))))))) as GROUP_FILTER,

   FROM

D:\.....

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

May be like attached?

View solution in original post

8 Replies
sunny_talwar

Only one of those fields will ever be 1?

MarcoWedel

I guess you could use a crosstable load to generate your Group_Filter field.

Please provide some sample data and expected result to demonstrate.

regards

Marco

PrashantSangle

Hi,

Explain little bit more . Hard to understand your requirement.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

See attached excel.

Not applicable
Author

Yes, thats right. So do you have any suggestion have to solve this?

Not applicable
Author

I would like to combine several field from an excel. If the field have value 1 I would like to use it in a list box as a filter.

See attached excel for sample data.

settu_periasamy
Master III
Master III

May be like attached?

MarcoWedel

Hi,

one solution to keep all source fields like your question suggests and using your unique ID field could be:

QlikCommunity_Thread_212196_Pic1.JPG

QlikCommunity_Thread_212196_Pic2.JPG

QlikCommunity_Thread_212196_Pic3.JPG

table1:

LOAD * FROM [https://community.qlik.com/servlet/JiveServlet/download/1013299-219878/jpgroup%20-%20Copy.xlsx] (ooxml, embedded labels, table is Blad1);

tabGrpFilt:

CrossTable (GROUP_FILTER,GROUP_FILTER_VALUE,4) LOAD * Resident table1;

Right Join

LOAD Distinct GROUP_FILTER_VALUE Resident tabGrpFilt Where GROUP_FILTER_VALUE;

DROP Field GROUP_FILTER_VALUE;

DROP Fields JPNUM, GROUPID, TYPEID From tabGrpFilt;

hope this helps

regards

Marco