如何将此SQL语句转换为ADF(数据流)表达式



有什么方法可以将此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元素的不同方法,但没有得到正确的结果。

谢谢!!!

&lt------已解决---->

解决方案:

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')))
)
感谢Petar Stojiljkovic。将您的讨论作为答案发布,以帮助其他社区成员。

将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')))
)

相关内容

  • 没有找到相关文章

最新更新