Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We would like to get users' job name and the result should give us jobname 'NoJob' unless the user has not job name How could we do that in qlickview.
Thanks
Users
ID | Name |
---|---|
1 | Alan |
2 | Jack |
3 | Aly |
UsersJob
ID | UserId | JobName |
---|---|---|
1 | 1 | lkjlklj |
2 | 3 | sdfsdfsdf |
SELECT | Users.ID,Users.Name,isnull(JobName,'NoJob') as JobName' |
FROM | Users LEFT OUTER JOIN |
UsersJob ON Users.ID = UsersJob.UserID | |
First make qvds : Users & Userjob from the Db tables
then,
Users:
mapping load * from Userjob.qvd;
JobNames:
Load *,
applymap('Users',ID,'NoJob') as JobName
from Users.qvd;
Regards
Try using a mapping table and applymap:
JobMap:
mapping load UserId,JobName
from ...somewhere...;
Users:
load ID, Name, applymap('JobMap',ID,'NoJob') as JobName
fro ...somewhereelse...;
First make qvds : Users & Userjob from the Db tables
then,
Users:
mapping load * from Userjob.qvd;
JobNames:
Load *,
applymap('Users',ID,'NoJob') as JobName
from Users.qvd;
Regards