Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Please visit COVID-19 group to keep up the discussion. GO TO GROUP
Not applicable

how to convert string (text) to an integer


I am playing around with a dataset I downloaded from the Internet to learn more about Qlick Sense. This table contains the horse name, the Result (if the horse won or lost) plus some other info.

I would like to create some graphs based on the Result column. The result column only contains the strings 'Won' or 'Lost'. I would like to convert this to an integer so I can do measures on it. For example I would like that the Won is converted to a 1 and the Lost is converted to a 0 so I can count the amount of Wins and see how many races a horse has won.

I thought about trying to do it in a case statement, but I am not sure if the case statement I wrote is actually correct or if maybe there is a better way of how to do this?

=if(match([Odds],'Win', '1',

if(match([Odds],'Lose', '0',


Any advise please?

1 Reply

Re: how to convert string (text) to an integer

In Qlik Sense, you can try this:

RangeSum(Match(Odds, 'Lose', 'Win'), - 1) as Win_Flag