Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cross Table

Can any one explain me the difference between cross table & a straight table..........?

6 Replies
khadeer
Specialist
Specialist

Hi,

Are you referring to Crosstable with cross tab.

Cross tables are table where facts are divided on the basis of dimension values.

for example we have sales for every month. then, if in our database we load sales amounts as a separated field for every month as

Product         Jan                    Feb                    Mar   etc

a                    100                    200                    300

So, basically we have 1 single fact as sales amount here, and jan-dec are dimension memebers of month dimension but we are creating different fields for every dimension member and treating them as different field.

Loading data this way, makes it difficult to properly aggregrate the data over different dimensions and difficult to do analysis.

So, we convert this crosstable into a normal table.

using

crosstable (Month, Amount)

load

*

from a.qvd(qvd);

then we will get the same table as

Product     Month     Amount

a                    jan          100

a                    feb          200

a                    mar          300

vikasmahajan

In cross table you can transform following information into row wise

DEPARTMENTJANFEBMARAPRMAY
A124546122375454
B445464344232465
C333122456454343
D123353122477121
E134657343575123

For us to use this table better in a QlikView data model, we need to convert it to a

traditional table with the following structure:

DEPARTMENTMONTHsum(SALES)
AAPR375
AFEB546
AJAN124
AMAR122
AMAY454
BAPR232
BFEB464
BJAN445
BMAR344
BMAY465
CAPR454
CFEB122
CJAN333
CMAR456
CMAY343
DAPR477
DFEB353
DJAN123
DMAR122
DMAY121
EAPR575
EFEB657
EJAN134
EMAR343
EMAY123

and in straight table you can select fields and display plain output.

Hope this help you to understand

Please refer cross.qvw for better understanding.

Good Luck

Vikas Mahajan

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

hi

Crosstable

A cross table is a common type of table featuring a matrix of values between two orthogonal lists of header data. To turn a cross table into a straight table, use a crosstable prefix.

The syntax is:

crosstable (attribute field , data field [ , n ] ) ( loadstatement | selectstatement )

where:

attribute field is the field to contain the attribute values.

data field is the field to contain the data values.

n is the number of qualifier fields preceding the table to be transformed to generic form. Default is 1.

Examples:

Crosstable (Month, Sales) Load * from ex1.csv;

Crosstable (Month,Sales,2) Load * from ex2.csv;

Crosstable (A,B) Select * from table3;

Crosstable Wizard

The crosstable wizard is dialog driven method of creating the crosstable syntax. This dialog is opened by clicking the Crosstable button in the Options page of the File Wizard. The crosstable wizard holds the following options:

   

Qualifier FieldsThe number of qualifier fields that precede the fields to be transformed.
Attribute FieldThe name of the new field that will contain all the fields (attribute values) to be transformed.
Data Field

The name of the new field that will contain the data of the attribute values.

Straight Table

An example of a Straight table

Charts are graphical representations of numerical data. The pivot table and the straight table are special cases as they display the data in table form while retaining all the properties of a chart. It is possible to switch between different representations of an existing chart, by changing the Chart Type in the Chart Properties: General page.

In opposition to the pivot table, the straight table cannot display sub-totals or serve as a cross table. On the other hand, any of its columns can be sorted and each of its rows contains one combination of dimension(s)+expression(s).

The quickest way to create a new straight table is to select Quick Chart Wizard from the Tools menu.

By a right-click on the straight table the Straight Table: Object Menu will be displayed. It can also be accessed from the Object menu, when the straight table is the active object.

vikasmahajan

Still you want know diff ?

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

see attachment of Crosstable

Not applicable
Author

Thank you vikas it is informative ,  help me solve my problem,

Month       A        B       C

  Jan        10        15      20
  Feb        25        30       5
  Mar         7         14     19
Here,
The numbers represent the customers,
Products  are (A,B,C),&
Month.
Month & Products are fields & i want to transpose them how can i do that..? And i want the same count even after transposing.