感谢Petar Stojiljkovic。将您的讨论作为答案发布,以帮助其他社区成员。
有什么方法可以将此SQL语句转换为ADF表达式(Window元素(吗?
CASE
WHEN MAX(
IF (cd.index = 1, cd.value, NULL) IN ('product', 'productListing')) THEN
CASE
WHEN MAX(
IF (cd.index = 2,cd.value,NULL)) LIKE '%sunglasses%' THEN
'Sunglasses'
WHEN MAX(
IF (cd.index = 2,cd.value,NULL)) LIKE '%glasses%' THEN
'Glasses'
WHEN MAX(
IF (cd.index = 2,cd.value,NULL)) LIKE '%contact%lens%' THEN
'Contact_Lenses'
ELSE
'No_Mapped'
END
ELSE
'No_Mapped'
END AS PageCategory
我尝试了在数据流中使用Window元素的不同方法,但没有得到正确的结果。
谢谢!!!
<------已解决---->;
解决方案:
case(
max(toString(iif(toInteger(index) == 1, value)) == 'product'), case(
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%sunglasses%') ,'Sunglasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%glasses%') ,'Glasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%contact%lens%') ,'Contact_Lenses',
toString('No_Mapped')
),
max(toString(iif(toInteger(index) == 1, value)) == 'productListing'),case(
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%sunglasses%') ,'Sunglasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%glasses%') ,'Glasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%contact%lens%') ,'Contact_Lenses',
toString('No_Mapped')
),
max(toString(iif(toInteger(index) == 1, 'No_Mapped')))
)
将SQL语句转换为ADF表达式。以下是可能的解决方案。
case(
max(toString(iif(toInteger(index) == 1, value)) == 'product'), case(
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%sunglasses%') ,'Sunglasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%glasses%') ,'Glasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%contact%lens%') ,'Contact_Lenses',
toString('No_Mapped')
),
max(toString(iif(toInteger(index) == 1, value)) == 'productListing'),case(
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%sunglasses%') ,'Sunglasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%glasses%') ,'Glasses',
like( max(toString(iif(toInteger(index) == 2, lower(value)))), '%contact%lens%') ,'Contact_Lenses',
toString('No_Mapped')
),
max(toString(iif(toInteger(index) == 1, 'No_Mapped')))
)