Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to have one listbox for querying multiple fields (logical OR beetwen)?

Hi All

I am quite new to QlikView and with my colleague we are trying to have a list box for querying multiple fields, without success.

Perhaps you are more experienced, and you may help :

First we have a QlikView document and the data come from a Excel sheet

The Excel sheet has two headers because it is possible to have multiple object of the same nature, for example

Place

person1

person2

name

nameagenameage
beachtoto25tarzan32
streetjane32john50
officemike42

We decided to simplify the file to a sigle header file:

Place-name

person1-nameperson1-ageperson2-nameperson2-age
beachtoto25tarzan32
streetjane32john50
beachmike42

And then we created a QlikView document from this file

What we are trying to do now is to filter by age.

For exemple we want all place names that are frequented by at leat one person of 32 years old

for example : 32 will give : street and beach

Unfortunately when we create a list box, it is linked to one single field ? But what we want here is to query multiple fields with a logical OR.

Any suggestion about how we can achieve that? What is the right way to do?

Hope it is clear enough

Thanks in advance

2 Replies
jonbrough
Valued Contributor

Re: How to have one listbox for querying multiple fields (logical OR beetwen)?

If you can want to have two columns, you should be able to create this table with two header rows using a pivot table.

In the script add a PersonNum field to your Persons table to say whether will appear in column 1, 2 ... n.

On the pivot chart:

First dimension = PlaceName

Second dimension = PersonNum (the column identifier)

First expression = only(PersonName)

Second expresison = only(Age)

You could then drag and drop dimension 3 (PersonNum) onto horizontal header to show person-1 or person-2 etc. columns.

dennisnet
Valued Contributor III

Re: How to have one listbox for querying multiple fields (logical OR beetwen)?

There are different ways to do this.

I would prefer to seperate the personnumber into a new field

In other word create data like this:

PlaceNameAgePersonNumber
beachtoto25Person1
streetjane32Person1
beachtarzan32Person2
officemike42Person1
streetjohn50Person2
office

I attached an example of one way to do this.

Is this what you are looking for?

Good luck.

Dennis.

Community Browser