Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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];
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().
Is this in Qlik Cloud or on-prem QlikSense?
on-prem QlikSense
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
may need to manually join them:
https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/LoadData/join-keep-t...
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.
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];
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().
Thanks so much this worked perfectly.