Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
cfarquharson
Contributor II
Contributor II

Can you make a Straight Table horizontal in Qlik Sense

Hi there,

I have a requirement to list a number of measures in a table, horizontally. I have attached a picture as an example of my table, it consists of 12 measures listed vertically, which looks ridiculous. Listing them horizontally will be more space efficient. 

In QlikView I was able to convert straight Tables from Vertical to Horizontal, is this no longer possible in Qlik Sense? Is there an extension out that will allow me to do this?

Labels (5)
5 Replies
aivislau
Partner
Partner

cfarquharson
Contributor II
Contributor II
Author

The problem is that I am not using any dimensions. A pivot table requires a dimension.

aivislau
Partner
Partner

A simple workaround is that you can create some "dummy" dimension in the pivot table and name it, for example, as "Values", "EUR" or whatever.

cfarquharson
Contributor II
Contributor II
Author

I can't see how this can solve my problem. This describes my scenario better:

I have measures listed in a table and I need to transpose this.

cfarquharson_2-1588874095700.png

This is possible in QlikView as you can create tables with no dimensions.

cfarquharson_0-1588874039507.png

I require an equivalent in Qlik Sense.

 

ArnadoSandoval
Specialist II
Specialist II

Hi @cfarquharson 

Yes, you can do it with QlikSense's load script; I am not aware of any Chart object able to do the transposition; with the load script you will be using:

  1. Generic (QlikSense Help) 
  2. Generic (QlikView Help) this help page include an example illustrating how the Generic prefix works.
  3. How to transpose rows to columns  about a year ago, in March-2019 somebody asked a similar question.
  4. The Generic Load (this post was quoted as a reference for the March-2019; it was written in 2014, it answers with more details how to implement the Generic prefix and transpose your table's row into columns.

I will share my own notes, as I played with your data and the information gathered from the posts-helps referenced above:

  • You need a table with your MonthlySummary, the one you included in your reply, it could be an Excel or CSV file.
  • Your Monthly-Summary table follows an structure known as key-value (very popular), each row represent a key-value combination, but unfortunately the Generic help page speak about a key in a different context, so, I will write property-value instead.
  • The Generic prefix expect these property-value to belong to a group, basically because it expect 3 columns: key-attribute-value; I hard coded all your property-value to Group 1 in the load script, as shown below
Measures:
Generic Load 1 As Group, MonthySummary, Value Inline [
MonthySummary, Value
Measure 1, 11
Measure 2, 12
Measure 3, 13
Measure 4, 14
Measure 5, 15
Measure 6, 16
Measure 7, 17
Measure 8, 18
Measure 9, 19
Measure 10, 110
Measure 11, 111
Measure 12, 112
];
  •  Notice the 1 As Group just after the load, there is no need to modify your data; but the implication is great, if you are dealing with multi-companies, instead of group, it could be a Company-ID instead and be part of your data, preventing the need of adding a dummy column.
  • The Generic Load create as many tables as rows in the data we are Loading, as your example contains 12 rows, it generates 12 tables.
  • The names of these tables are [table-name].[property-name]; I used Measures as the table name, so I ended up with 12 tables with these names: Measures.Measure 1; Measure.Measures 2; ... ; Measures.Measure 12; these tables contain two columns group and property-name; so for the first table: Measures.Measure 1, its two columns are Group and Measure 1; for the next table Measures.Measure 2 its two columns are Group and Measure 2, and so on. Notice that all these 12 tables share the column Group, the first parameter appearing on the Load and the we forced to 1; also each one of these tables have a single row.
  • Now this partial result looks very messy, 12 tables and we want just one table, that's when the post referenced on the link above saved the day, as it contains a block of code that join all these 12 tables into 1, with as many columns as properties. (You need to visit that post)
  • There are a couple of things you need to know before using the code you are about to find, they are highlighted below:

BlockOfCode_01.jpg

and

BlockOfCode_02.jpg

And this is the result table screenshot:

Results.jpg

Hope this helps

 

 

 

 

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.