Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a dimension called Lot that list the following series:
XO24G001D
XO24G001E
XO24G001
XO24T001
XO24T001D
XO24T001E
I would to exclude D and E from the list. I tried the expression
=IF(MID(LOT,5,1)='T' AND left(LOT,1)<>'D' OR LEFT(LOT],1)<>'E' ,
LOT)
but, it did not seem to filter out D and E.
test:
LOAD *,Replace(Replace(Field1,'D',''),'E','') as Field2;
load * Inline [
Field1
XO24G001D
XO24G001E
XO24G001
XO24T001
XO24T001D
XO24T001E
];
This would work..
//LOAD * where not WildMatch(LOT,'*E', '*D'); // this will exclude records from data
LOAD *, IF(not WildMatch(LOT,'*E', '*D'), 1, 0) as ExcludeFlag; // this can create flag
LOAD * INLINE [
LOT
XO24G001D
XO24G001E
XO24G001
XO24T001
XO24T001D
XO24T001E
];
If you want in expression.. you can use below one
ONLY({<LOT-={"*D","*E"}>}LOT)
I hope this helps!
This expression will extract the first 8 characters from the 'Lot' field.
=Mid(Lot,1,8)
This will work all the cases.
//LOAD * where not WildMatch(LOT,'*E*', '*D*'); // this will exclude records from data
LOAD *, IF(not WildMatch(LOT,'*E*', '*D*'), 1, 0) as ExcludeFlag; // this can create flag
LOAD * INLINE [
LOT
XO23D023
XO23D023
XO23D023D
XO23D023DG
XO23T001
XO23T001A
XO23T001A
XO23T001AB
];
If you want in expression.. you can use below one
ONLY({<LOT-={"*D*","*E*"}>}LOT)
Hi @Qlik17 ,
Try this :
{<Lot-={"????T*D","????T*E"}>}
in your set & check. This will check if T is present at the 5th position & if the string ends in D or E.
Regards,
Rohan.
Try this
=IF(
WildMatch(LOT, '*D') = 0 AND WildMatch(LOT, '*E') = 0,
LOT
)
Try this too.=IF(
WildMatch(LEFT(LOT, len(LOT)-1), '*D') = 0 AND WildMatch(LEFT(LOT, len(LOT)-1), '*E') = 0,
LOT
)