Forum Discussion
ChrisMcHugh
Helper I
4 years agoUse an IF on a column containing string value that if it returns true, returns a number
IF(AND(AND(AND(AND(VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] = "LOADED", (VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS]) <> "PARTIALLY LOADED"), (VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS]) <> "FAILED...
Samarth_18
Community Champion
4 years agoHi ChrisMcHugh ,
If I took your question correctly then I think you could try below code:-
IF (
VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] = "LOADED"
&& VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] <> "PARTIALLY LOADED"
&& VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] <> "FAILED"
&& VW_STAGING_TO_ACQ_LOAD_DETAIL[TABLE_NAME] = "ROUTES",
0
)
BR,
Samarth
- ChrisMcHugh4 years ago
Helper I
Hi Samarth,
Yes it is along those lines for definite. However, upon trying your code, this is the error I am getting.
Is there any way to work around this as I am directly pulling from a column in a dataset
- Samarth_184 years ago
Community Champion
ChrisMcHugh Please update it as:-
IF ( MAX ( VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] ) = "LOADED" && MAX ( VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] ) <> "PARTIALLY LOADED" && MAX ( VW_STAGING_TO_ACQ_LOAD_DETAIL[LOAD_STATUS] ) <> "FAILED" && MAX ( VW_STAGING_TO_ACQ_LOAD_DETAIL[TABLE_NAME] ) = "ROUTES", 0 )- ChrisMcHugh4 years ago
Helper I
Yes it seems to be working to some extent! I will have to nest IF and IFELSE for different conditions but the basics of it are correct, thank you
- ChrisMcHugh4 years ago
Helper I