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

Help with multiple choise field

I hava a field in the database where the user can choose from multiple alternatives.

Example:

Field:

Alt 1

Alt 2

Alt 3

The user can now choose from the alternatives in the box and the choise is saved in the database in same field with the seperatert ;

Example: ;Alt 1;Alt 3;

Lets say that a project table have this multiple field. And now users create projects and choose differnt combinations for each project.

If i load this infomration into QV it will make one alternativ for each uniqe combination. So if i dispolat this field in a QV document it will look something like this:

;Alt 1;

;Alt 1;Alt 2;

;Alt 1; Alt 3;

;Alt 2; Alt3;

;Alt3;

Now i want to know how many projects is Alt 1 represented in. If i choose Alt 1 in the field above it will only show me project where ONLY Alt 1 is chosen. But i have other project where Alt 1 is on of many multiple chooises.

I'll hope that somebody could help mw with this. If i have explained it to bad dont hesitate to ask for further information.

Thanks!

I would now like to

12 Replies
swuehl
MVP
MVP

Hi samir,

you might want to take a look at the conditional functions, especially match / mixmatch / wildmatch.

maybe something like

count(if(wildmatch (projectsfield, '*' & 'Alt 1' & '*')>0,1))

Stefan

Not applicable
Author

But that only solves the count in the diagram. I would like to make a Field object where the user can choose from the alternatives:

Alt 1

Alt 2

Alt 3

Maybe i didnt understand you correct, if so could you explain more detailed?

swuehl
MVP
MVP

Alternatively, you could probably use a set expression like

count ({<projectsfield = {"*Alt 1*"}>} projectsfield)

lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example

using the subfield function in the load script

you should note that it creates more then one record for project

so this table sholud be conected to the project table and not join

hope its helps

swuehl
MVP
MVP

Thanks for the example, I think that helps.

Still I don't understand your requirement.

If a add a list box with field ProjectCategory to the sheet, do I have a field object like you desire to choose Category from?

And what measure do you want to be calculated at what place (e.g. new table column or text box)?

Sorry If I am a bit slow today.

Stefan

swuehl
MVP
MVP

Maybe something like this?

I removed the subfield and added a table with just projectCategory manually (you could probably get it from your DB easily).

Then added mentioned list box and a chart table with expression like mentioned before.

Cheers,

Stefan

Not applicable
Author

qv.png

Look at the picture.

As you se i have each uniqe combination.

What i would like tho show is:

Alt 1:

Alt 2:

Alt 3:

and when pressing for example alt 1 i would like to show the sum(value) for every project where Alt 1 are presented.

swuehl
MVP
MVP

Hi samir,

thought I was close...

Hm, just added some values to my data and prettied up the charts.

Maybe like attached sample app? (Still not sure what you are after)

It might be an idea to get rid of the concattenated strings and use a many to many linkage table instead (but that's probably  not the problem we are talking about).

Regards,

Stefan

swuehl
MVP
MVP

Me again,

if you don't like my inlined ProjectCategory table, you might use

Category:

Load Distinct

SubField(CategoryMix,';') as ProjectCategory

resident Project;

instead.

Regards,

Stefan