【发布时间】:2015-09-02 12:18:15
【问题描述】:
有一个内联加载,我必须将歌曲 ID 添加到豁免列表:
Exemptsongs:
Load * Inline [
Song ID
45875
65463
43785
90347
23456
89438
16745
];
Exemptsongsmap:
Mapping LOAD
[Song ID],'Exempt' as [Exempt songs exempt]
Resident Exemptsongs;
DROP Table Exemptsongs;
然后在需要时将其加载到播放列表的其他位置。
我想要做的也是添加由特定用户添加的歌曲 ID 以进行豁免,但仅当该用户添加时,其他人添加时它们不会被豁免(除非在豁免列表中特别列出以上)。
我在想(伪)这样的事情:
Exemptsongs:
Load * Inline [
Song ID
45875
65463
43785
90347
23456
89438
16745
(SELECT SongID FROM Songs WHERE addedbyuser = 'MATT')
];
Exemptsongsmap:
Mapping LOAD
[Song ID],'Exempt' as [Exempt songs exempt]
Resident Exemptsongs;
DROP Table Exemptsongs;
那么在加载播放列表时,applymap 部分目前是这样的:
ApplyMap('Exemptsongsmap',[Playlist ID],'Non-exempt') as [Exempt songs exempt],
但是想不到如果songid也是由其他人添加的,如何不让songid免于豁免。
例如
如果用户 matt 添加了歌曲 ID 12345 并且另一个用户添加了它,我希望它在由 matt 添加时在播放列表中被排除。
错误 1:
Syntax error, missing/misplaced FROM:
Exemptsongs:
Load [Song ID]& as UniqueID Inline [
Song ID
45875
65463
43785
90347
23456
89438
16745
]
Exemptsongs:
Load [Song ID]& as UniqueID Inline [
Song ID
45875
65463
43785
90347
23456
89438
16745
]
错误 2:
Field not found - <Song ID>
load [Song ID]&addedbyuser as UniqueID
from Songs
where addedbyuser='Matt';
错误 3:
Table not found
Exemptsongsmap:
Mapping LOAD Distinct
UniqueID,'Exempt' as [Exempt songs exempt]
Resident Exemptsongs
错误 4:
Table not found
DROP TABLES statement
然后是我们没有改变的东西的多个其他错误......
【问题讨论】:
标签: subquery mapping case qlikview