Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have connected Qlik sense with a database and want to load the following data. The Sql query is below. However I am having trouble loading the data due to error in the following codes. Can someone suggest why this doesn't work?
Thanks.
LOAD ID,
ComponentSales,
Sales,
Territory,
Volume,
ComponentName,
"Type"
SQL with relevantComponents as
(
select [ComponentName], [Value], [Type] from SALESREPORTING.dbo.Components
where ([ReportRunId] = 901) AND ([AggregationId] = 'MainOneMonth')
)
SELECT *
FROM relevantComponents
pivot (
max([Value])
for [Type] in ([ComponentSales], [Sales], [Territory], [Volume])
)
as datapivot;
Try adding a semicolon after "Type". A preceding load needs to be terminated with a ; character.
Hi Gysbert, thank you for the suggestion. I've added a semicolon after type but it still does not load... Can you see anything else wrong with it?
I don't see a field ID anywhere in the sql statement.
Hi Gysbert, sorry I don't understand... aren't ID, ComponentSales, etc field IDs?
Thanks.
LOAD ID,
ComponentSales,
Sales,
Territory,
Volume,
ComponentName,
"Type"
You tell Qlikview to load a field called ID. Where does that field come from? I don't see it in the sql statement.