Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey everyone,
So I have a field called order type and I want to take the last two characters of the values that have "BD", and make a Yes/No bucket or a BD Flag dimension with values Y and N.
So something like
If(OrderType='BD','Y','N')
But I know I'm missing the part that specifies BD as the last two characters.
Thanks
Rocco
Hello
if(right(OrderType,2)='BD','Y','N')
Regards
the function you are looking for is Right(). Also, I recommend defining a numeric flag, instead of alphanumeric. Your expressions with the flag will be much more efficient:
If(Right(OrderType, 2)='BD',1,0)
cheers,
Oleg Troyansky
www.masterssummit.com - take your QlikView skills to the next level!
Hi,
one possible solution could be also:
LOAD *,
If(OrderType like '*BD',Dual('Y',-1),Dual('N',0)) as [BD Flag]
Inline [
OrderType
GHIJKLBDMNOPQRST
ABHIJKLMNOPXYZBD
BCDEFGOPQRYZ
DEFGTUVWXYZ
DEFGHIJKLQRSYZ
DEFMNSTUVWXBD
FGHIJKLMNOPQRSTUV
CDEFGHIJKLMNOUBD
BDEFGHIJKLMWXYZ
GHIJKLMNOPQRSTUBD
CDEFGHIJKLMNOPQRXYZ
FGHIBDLMNOPQRSTUVWZ
]
Creating dual values allows you to use the BD Flag field e.g. like this:
hope this helps
regards
Marco