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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Diere29
Contributor III
Contributor III

Crosstab table wont connect with a inline table

I am trying to connect two tables in Qlik Sense, one being an inline table and the other a table which uses the CrossTable function.

However, when Qlik automatically links them, it doesn’t create a single distinct key for the category field. Instead, it duplicates the values, causing entries like 1 to appear twice and 2 to appear twice. The category values from the cross-table do not align properly with the values from the inline table, which prevents them from connecting as expected. Why is this occurring ? this is in on-prem QlikSense environment.  

CROSS-TAB TABLE: 

NoConcatenate
[Write-off_1]:
LOAD
"Store no",
"Date",
"PO Number",
"SKU",
Sum(TTL) as "Write-off Applied",
Sum(OCEAN FREIGHT) as [1],
Sum(AIR FREIGHT) as [2]
GROUP BY
Store no",
"Date",
"PO Number",
"SKU",
DROP TABLE [IP_IPIZTRN];

CrossTable(Category, Values, 5)
[Write-off]:
LOAD *
RESIDENT [Write-off_1];
DROP TABLE [Write-off_1]

INLINE TABLE: 

Category_Map:
LOAD Category, Category_Description
INLINE
[Category,Category_Description
1,1 OCEAN FREIGHT
2,2 AIR FREIGHT];

 

1 Solution

Accepted Solutions
marcus_sommer

num() doesn't perform a converting else it's just a formatting. To change the interpretation you need num#() respectively text() to get it in the opposite direction. Further helpful might be to check the values with isnum() and istext().

View solution in original post

8 Replies
David_Friend
Support
Support

Is this in Qlik Cloud or on-prem QlikSense?

Diere29
Contributor III
Contributor III
Author

on-prem QlikSense

eddyvargas
Contributor III
Contributor III

The script works without the load inline? Are you sure the last parameter of Crosstable fuctions is 5? the group by are for 4 fields

marcus_sommer

Make sure that the keys in both tables have the same data-interpretation - means they are numbers or strings but not mixed in any way.

Diere29
Contributor III
Contributor III
Author

yea, I have been trying that but they don't connect still. When I cast the Category as a number it makes the tables align distinctly but then all the values under category go null and default to - 

// Step 5: Apply the CrossTable transformation
CrossTable(Category, Values, 12)
[Write-off_2]:
LOAD *
RESIDENT [Write-off_1];
DROP TABLE [Write-off_1];

// Step 6: Apply the CrossTable transformation
[Write-off_3]:
LOAD *,
Num(Category_) AS Category
RESIDENT [Write-off_2];
DROP TABLE [Write-off_2];

marcus_sommer

num() doesn't perform a converting else it's just a formatting. To change the interpretation you need num#() respectively text() to get it in the opposite direction. Further helpful might be to check the values with isnum() and istext().

Diere29
Contributor III
Contributor III
Author

Thanks so much this worked perfectly.