Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
ykk
Contributor
Contributor

Create table which expands horizontally

Hi all,
We want to create a report using similar function as levels, but have them displayed horizontally
(So the data would grow Left to Right rather than the standard Top to Bottom)

For example, while the standard Levels could create tables such as below which expands vertically,
Country A - Currency a - Population aa
Country B - Currency b - Population bb
Country C - Currency c - Population cc
.
.
.
We want them expand horizontally, like
Country A          Country B          Country C
Currency a        Currency b        Currency c
Population aa    Population bb    Population cc ................

Looking at the past forum QAs, I see that Nprinting didn't support this functionality a few years ago,
but wanted to know if this is still the case
If not, could someone please advise any idea to realize these ?
(We've also explored PixelPerfect but we found it difficult to create a team that could support maintenance in the long term)

Please kindly let me know if there's any other info to be provided from my end, Thank you!

Labels (2)
1 Solution

Accepted Solutions
henrikalmen
Specialist II
Specialist II

Perhaps this example can be useful. I loaded the test script that you get from pressing "ctrl 0 0" in script editor and I'm using the table "ASCII" in this example. The top table shows the contents of that table, the bottom table is hopefully what you want to achieve. 

henrikalmen_1-1756978499898.png

 

I'm using a pivot table. The row dimension is this expression: =valuelist('The alpha value','The num value')

As column dimension I used the field Num (that would be Country with your data).

The value expression is: 
=pick(match(Valuelist('The alpha value','The num value'),'The alpha value','The num value'),AsciiAlpha,AsciiNum)

The row dimension will iterate over the values given to the valuelist function. The value expression checks each value in the valuelist, and if the value matches the value in the row dimension (the row valuelist), the correct field will be used.

View solution in original post

2 Replies
MT4T
Creator
Creator

Hi I have this script for pivoting crosstable. This is good guide The Generic Load - Qlik Community - 1473470

   Set vListOfTables = ;

   For vTableNo = 0 to NoOfTables()

      Let vTableName = TableName($(vTableNo)) ;

      If Subfield(vTableName,'.',1)='Generic' Then

         Let vListOfTables = vListOfTables & If(Len(vListOfTables)>0,',') & Chr(39) & vTableName & Chr(39) ;

      End If

   Next vTableNo
	 CombinedGenericTable:

   Load distinct [GlobalName] Resident data_loaded
   /*From Generic */
   /*RESIDENT '$(vTableName)' */
   /*FROM [lib://EMARK:DataFiles/SCEP_LineUp_2023_05.xlsx]*/
   ;

 

   For each vTableName in $(vListOfTables)

      /*Left*/OUTER Join (CombinedGenericTable) Load * Resident [$(vTableName)];

      Drop Table [$(vTableName)];

   Next vTableName
henrikalmen
Specialist II
Specialist II

Perhaps this example can be useful. I loaded the test script that you get from pressing "ctrl 0 0" in script editor and I'm using the table "ASCII" in this example. The top table shows the contents of that table, the bottom table is hopefully what you want to achieve. 

henrikalmen_1-1756978499898.png

 

I'm using a pivot table. The row dimension is this expression: =valuelist('The alpha value','The num value')

As column dimension I used the field Num (that would be Country with your data).

The value expression is: 
=pick(match(Valuelist('The alpha value','The num value'),'The alpha value','The num value'),AsciiAlpha,AsciiNum)

The row dimension will iterate over the values given to the valuelist function. The value expression checks each value in the valuelist, and if the value matches the value in the row dimension (the row valuelist), the correct field will be used.