Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
abg_emea
Contributor II
Contributor II

Multiple Columns - Wrong Data Showing

Hi There,

I am very new to Qlik and I am trying to do the following pulling from an Azure database:

Source:

Order NumberBurgersSausagesFriesNuggets
1231110
1241122
1250011

 

Output:

 Orders
Burgers1
Sausages2
Fries3
Nuggets2

 

If it matters there are around 10 other columns which we are using elsewhere in the workspace.

It looks like cross table may be what I need but I cannot figure it out for the life of me.

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try:

[stuartclean]:
CrossTable(Product,Orders,14)
SELECT "Bill Payer",
"Sales Channel",
"Distribution Channel",
RRR,
"Rental Car Group Code Charged",
"Rental Car Group Code Driven",
"Location Name",
"Checkout Date",
"Checkin Date",
Leadtime,
"Mnemonic Location Code",
"Checkout Station Type",
Rental,
NOANCIL,
RSN,
"ADD",
GPS,
CSS,
CCO,
TPR,
WFI,
AFO,
STK,
BBS,
TCT,
BKF
FROM "sql".dbo.stuartclean;

talk is cheap, supply exceeds demand

View solution in original post

5 Replies
abg_emea
Contributor II
Contributor II
Author

I forgot to add - I would be grateful for any help!
Gysbert_Wassenaar

You can load the data using the CrossTable function with somehting like this:

MyTable:
CrossTable(Product,Orders)
SELECT * FROM ...azure_source_table_here... ;

Then you can create a table object in the front end with Product as dimension and sum(Orders) as measure.


talk is cheap, supply exceeds demand
pradosh_thakur
Master II
Master II

share the part of the script you are using to fetch these data.
Learning never stops.
abg_emea
Contributor II
Contributor II
Author

Sure, here is the load script for the Azure table:

 The ones in bold are the products

[stuartclean]:
SELECT "Bill Payer",
"Sales Channel",
"Distribution Channel",
RRR,
"Rental Car Group Code Charged",
"Rental Car Group Code Driven",
"Location Name",
"Checkout Date",
"Checkin Date",
Leadtime,
"Mnemonic Location Code",
"Checkout Station Type",
Rental,
NOANCIL,
RSN,
"ADD",
GPS,
CSS,
CCO,
TPR,
WFI,
AFO,
STK,
BBS,
TCT,
BKF
FROM "sql".dbo.stuartclean;

Gysbert_Wassenaar

Try:

[stuartclean]:
CrossTable(Product,Orders,14)
SELECT "Bill Payer",
"Sales Channel",
"Distribution Channel",
RRR,
"Rental Car Group Code Charged",
"Rental Car Group Code Driven",
"Location Name",
"Checkout Date",
"Checkin Date",
Leadtime,
"Mnemonic Location Code",
"Checkout Station Type",
Rental,
NOANCIL,
RSN,
"ADD",
GPS,
CSS,
CCO,
TPR,
WFI,
AFO,
STK,
BBS,
TCT,
BKF
FROM "sql".dbo.stuartclean;

talk is cheap, supply exceeds demand