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: 
ab92
Creator II
Creator II

Condition

Good afternoon every one !

Please, see below my request :

In one field, I have this :

the result end to : +375

I would like to sort the numbers present : create a condition to show the numbers between

0 to -9

-10 to -149

-150 to -499

-500 to -700

-700 to the ends from the numbers present...

I tried this but unfortunatly is not wrking : could you help me please :

load*,
if(TDM6_R<0 and TDM6_R<-10,'0 à -10',
if(TDM6_R<=-10 and TDM6_R<-150,'-10 à -149',
if(TDM6_R<=-150 and TDM6_R<-500,'-150 à -499',
if(TDM6_R<=-500 and TDM6_R<=-700,'-500 à -700','Résultat inf à -701'
)
)
)
)
as Distance_Parcourue_Inf,

Many thanks for your help.

Best regards,

Axel

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Nearly got it:

try this:

load*,
if(TDM6_R<0 and TDM6_R>-10,'0 à -10',
if(TDM6_R<=-10 and TDM6_R>-150,'-10 à -149',
if(TDM6_R<=-150 and TDM6_R>-500,'-150 à -499',
if(TDM6_R<=-500 and TDM6_R>=-700,'-500 à -700','Résultat inf à -701'
)
)
)
)
as Distance_Parcourue_Inf,

View solution in original post

16 Replies
sunny_talwar

Try this

if(TDM6_R > -10 and TDM6_R < 0, '0 à -10',
if(TDM6_R > -150, '-10 à -149',
if(TDM6_R > -500, '-150 à -499',
if(TDM6_R > -700, '-500 à -700','Résultat inf à -701')))) as Distance_Parcourue_Inf,

alexandros17
Partner - Champion III
Partner - Champion III

Nearly got it:

try this:

load*,
if(TDM6_R<0 and TDM6_R>-10,'0 à -10',
if(TDM6_R<=-10 and TDM6_R>-150,'-10 à -149',
if(TDM6_R<=-150 and TDM6_R>-500,'-150 à -499',
if(TDM6_R<=-500 and TDM6_R>=-700,'-500 à -700','Résultat inf à -701'
)
)
)
)
as Distance_Parcourue_Inf,

ab92
Creator II
Creator II
Author

HI Sunny

Many thanks for your help but it takes the number Superior to 0

it takes numbers to -142 to + 375 for the first selection -10 à -149...

sunny_talwar

Then add this

if(TDM6_R > -10 and TDM6_R < 0, '0 à -10',

if(TDM6_R > -150 and TDM6_R <= -10, '-10 à -149',

if(TDM6_R > -500 and TDM6_R <= -150, '-150 à -499',

if(TDM6_R > -700 and TDM6_R <= -500, '-500 à -700',

if(TDM6_R <= -700, 'Résultat inf à -701'))))) as Distance_Parcourue_Inf,

ab92
Creator II
Creator II
Author

I just tried your solution is perfect

I was very close I knew it, many thanks for your help Alessandro

ab92
Creator II
Creator II
Author

Hi Dunny,

I tried also and it's working thanks a lot Dunny for your help !

sunny_talwar

Dunny? Who is Dunny my friend... my name is Sunny with a S

ab92
Creator II
Creator II
Author

Sorry Sunny I don't take my glasses ^^ an other question last if you the time of curse ...

I need to calculate the deviation regarding the same field : TDM6_R

I took this formul :

Stdev(TDM6_R)

But I think is not this, do you have an idea my friend ...?

sunny_talwar

Where are you trying to use this? Script or front end? Also, which object if it is on the front end...

Stdev(TOTAL TDM6_R)