• No results found

AND Mode

N/A
N/A
Protected

Academic year: 2021

Share "AND Mode"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

AND-MODE

QlikView Technical Brief

June 2013 QlikView 11.2

(2)

AND-Mode | 2

Contents

INTRODUCTION ... 3

SET THE SCENE ... 4

FUNCTIONS,FEATURESANDTRICKSUSED ... 4

DATA MODEL ... 4

TABLES ... 4

SCRIPT... 5

STEPS TO IMPLEMENT AND-MODE IN A LIST BOX ... 6

SUMMARY ... 10

(3)

AND-Mode | 3

Introduction

In this document, the steps necessary to use AND-Mode in your QlikView list box will be explored. What is AND-Mode? AND-Mode allows us to change the logic in a list box from OR to AND so when making multiple selections in a list box, data associated with all the selections is displayed. This document will cover the criteria that need to be met before AND-Mode can be used and the steps necessary to add the functionality to a QlikView application.

SUPPORTING MATERIALS

QVW. A QVW titled AND

Mode.qvw was created to illustrate how to use AND-Mode.

(4)

AND-Mode | 4

Set the Scene

By default, multiple selections in a list box are interpreted as a logical OR so when more than one item is selected in a list box, the other fields will display data associated with any of the selections. When using AND-Mode, the other fields will display data associated with all of the selections.

FUNCTIONS, FEATURES AND TRICKS USED The following QlikView features were used:

• AND-Mode • Use of Distinct

Data Model

Before beginning, let’s take a look at the data model and how we loaded the field that will be used for AND-Mode. Below is an illustration of the data model created.

TABLES

• Customers - stores the customers

• SalesDetails – stores the transactions made by the customers • ItemMaster – stores product information

(5)

AND-Mode | 5

Script

For the most part the script used to create the data model is straight-forward but there are some rules when creating the table (ANDModeTable) that stores the field that will be used in the AND-Mode list box.

1. The table that stores the AND-Mode field has to be in a table with only two fields, one of which is a key and the other which is the field that will be used in the AND-Mode list box.

2. The records in the ANDModeTable must be distinct.

Here is the script used to illustrate AND-Mode:

The Customers, ItemMaster and SalesDetails tables are loaded from QVDs. To create the ANDModeTable, the Distinct keyword is used to load the Customer Number field which is a key field and Product Sub Group Desc which is the field that will be used in the AND-Mode list box. If the Distinct clause is excluded from the Load statement, AND-Mode will not work. It is not enough that the table contains only distinct records or that the data is loaded using a “SELECT distinct,” the Distinct clause must be included in the Load statement. Since we want to use the Product Sub Group Desc field in the application to see what customers bought, it is important to create the ANDModeTable from the SalesDetails table that has all the customer transactions.

(6)

AND-Mode | 6 Now that the data model is created, we can move to the UI to see how we set up the AND-Mode

feature.

Steps to Implement AND-Mode in a List Box

Now that the data model is complete, the AND-Mode list box can be created.

1. Add a list box to the sheet for the Product Sub Group ANDMode field. This is the field created in the script specifically for AND-Mode use.

2. Right-click on the list box and select Properties.

3. Go to the General tab and check the And mode check box. This option is enabled because we followed the proper criteria for using AND-Mode: the AND-Mode field is one of two fields in a table and distinct was used when creating the table. If the AND-Mode check box is disabled then the field was not set up properly.

(7)

AND-Mode | 7 4. Click the OK button.

Now that the AND-Mode list box is created, let’s take a look at how it can be used. On the sheet, there is a normal list box for Product Sub Group that works like a default QlikView list box and there is an AND-Mode list box for the Product Sub Group. Normally, you would use one or the other but this document has both to illustrate the differences between the two.

When a selection is made in the Product Sub Group – Default list box, it works as expected using a logical OR. The other fields on the sheet will filter if there is a data association to any of the selections. For example, when Bologna and Cheese are selected, the pivot table is filtered to show customers who purchased Bologna or Cheese. Since it is a logical OR, we can see that some customers purchased Bologna, some purchased Cheese and some purchased both Bologna and Cheese.

(8)

AND-Mode | 8 Now if the Product Sub Group – ANDMode list box is used to make the Bologna and Cheese

selections, the results will be different. Using AND-Mode, uses a logical AND instead of OR so the data returned in the pivot table will show customers who purchased both Bologna and Cheese.

Notice in the Product Sub Group – ANDMode list box, there is an amperstand (&) in front of the selected values. This is the case when Mode is activated. Another feature of the AND-Mode is the ability to make selections a NOT which is a forced exclusion of a value. For

(9)

AND-Mode | 9

example, we are looking at customers who purchased Bologna and Cheese but what if we want to see customers who purchased Bologna and Cheese and not Sliced Bread. We can see this by making an additional selection in the Product Sub Group – ANDMode list box. To make a NOT selection, click on the item and hold it a moment, the selection will switch from an AND to a NOT selection and will appear in red with an exclamation point (!) in front instead of an

amperstand.

Once this selection is made, the pivot table will display customers who purchased Bologna and Cheese and did not purchase Sliced Bread.

(10)

AND-Mode | 10

This is a good way to see what items were purchased together or not purchased together.

Summary

In this technical brief, the steps to add an AND-Mode list box to a QlikView application was explored. The criteria that must be met when creating the data model as well as how to activate the functionality was reviewed. Examples were also provided on how the AND-Mode can be used and how if differs from the default list box.

References

Below are supporting materials that may be helpful:

QVW – AND Mode.qvw www.qlikviiew.com

© 2012 QlikTech International AB. All rights reserved. QlikTech, QlikView, Qlik, Q, Simplifying Analysis for Everyone, Power of Simplicity, New Rules, The Uncontrollable Smile and other QlikTech products and services as well as their respective logos are trademarks or registered trademarks of QlikTech International AB. All other company names, products and services used herein are trademarks or registered trademarks of their respective owners. The information published herein is subject to change without notice. This publication is for informational purposes only, without representation or warranty of any kind, and QlikTech shall not be liable for errors or omissions with respect to this publication. The only warranties for QlikTech products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting any additional warranty.

References

Related documents

■ Before using, test the Ground Fault Circuit Interrupter (GFCI) provided with the power cord to ensure it is operating properly.. GFCI reduces the risk of

Key words: bile duct proliferation, chlordanes, dichlorodiphenyltrichloroethane, dieldrin, East Greenland, HCB, hexacyclohexanes, Ito cells, lipid granulomas, liver, mononuclear

Therefore, in order to protect the people of our country, the government must discourage the abuse of alcohol, especially among our young people.. Adults

Co-coordinator - First Annual Nationwide Forensic Nursing Death Investigation Course at Harris County Medical Examiner Office, Houston, TX, 2005;. Presenter – “ Conducting

Such a collegiate cul- ture, like honors cultures everywhere, is best achieved by open and trusting relationships of the students with each other and the instructor, discussions

Levels of canonical PRC1 subunits in RING1B-deficient cells showed alterations of opposed signs, compared to those in control (tissues from mice without MxCre

Whether we are speaking of corporate training, continuing education, academic courses, or even entire degree programs, the traditional mainstays of quality assurance such as

Despite this, however, Eastern European activists were motivated to stick with the global agenda because it promised them an equal position within the movement,