Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

expression

hi guys,

need assistance on this scenario,

data is like this:

Column1:

asdf1234-1

dfgf2345-11

gdd4567cc-1

ghj4563ccc-12

aser8762-213

expected output:

Column1,OutPut

asdf1234-1,1

dfgf2345-11,0

gdd4567cc-1,1

ghj4563ccc-12,0

aser8762-213,0

Note for output: If we have only "1" after "-" display as 1 else 0.

I tried with mid(),not success-ed completely.

thanks in advance.

2 Replies
sunny_talwar

Try this:

Table:

LOAD *,

  If(SubField(Column1, '-', 2) = 1, 1, 0) as Output;

LOAD * Inline [

Column1

asdf1234-1

dfgf2345-11

gdd4567cc-1

ghj4563ccc-12

aser8762-213

];


Capture.PNG

Kushal_Chawda

another

Table:

LOAD *,

if( right(Column1,2)='-1',1,0) as Output;

LOAD * Inline [

Column1

asdf1234-1

dfgf2345-11

gdd4567cc-1

ghj4563ccc-12

aser8762-213

];