Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I will try my best to explain my issue and hopefully you smart community of developers can assist me ![]()
I am loading a "lookup" table from an excel document as its own table in Qlikview, then subsequently using a SQL select statement to grab data into another named table with the goal to later reference the table to return GeneratorCategory's value.
So,
//Lookup Table
LeadGenRole:
LOAD Lead_Generator_Role,
MAX_LEAD_ROLE,
GeneratorCategory
FROM
(ooxml, embedded labels, table is Generator);
And then,
//SQL data
Bookings:
Select
om.*
,sf2.MAX_LEAD_ROLE
,CASE
when om.CATEGORY in ('Partner','Shared') then om.CATEGORY
else (If the condition fails, then lookup sf2.MAX_LEAD_ROLE against LeadGenRole's MAX_LEAD_ROLE and return GeneratorCategory)
end as FinalCategory
from [Server].[dbo].[View] om
left join [Server2].[DB].[dbo].
Hello.
You can use Mapping Load and ApplyMap:
//Lookup Table
LeadGenRole:
Mapping LOAD
MAX_LEAD_ROLE,
GeneratorCategory
FROM
(ooxml, embedded labels, table is Generator);
//SQL data
Bookings:
Load
*,
if(CATEGORY = 'Partner' or CATEGORY = 'Shared', CATEGORY, ApplyMap('LeadGenRole', MAX_LEAD_ROLE, 'Not found') ) As FinalCategory
;
Select
om.*
,sf2.MAX_LEAD_ROLE,om.CATEGORY
from [Server].[dbo].[View] om
left join [Server2].[DB].[dbo].
sf2
on om.Opportunity_ID = sf2.OPPORTUNITY_ID
where om.DATE >= '201202'
;