Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tomcatxx
Creator
Creator

Odd to natural number

Hi there,

I have a table like that.

Number.PNG

Column 'Numb' contains odd values 1,3, 5, 7, ......145,, 147. But I just need 1, 2, 3, 4......

That means I need a new column, in which all 1 is 1

                                                                    all 3 is 2

                                                                    all 5 is 3

                                                                    all 7 is 4 and so on.

I write script with if(), but it is too much. Is there some easy method to solve it?  Thank you.

1 Solution

Accepted Solutions
ogautier62
Specialist II
Specialist II

Hi

you could try ceil(Numb/2)

regards

View solution in original post

2 Replies
ogautier62
Specialist II
Specialist II

Hi

you could try ceil(Numb/2)

regards

Anonymous
Not applicable

try in script

div(Numb,2)+1 as Numb

or in table only

div(Numb,2)+1