Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

sachinnataraj
New Contributor II

If statement

Hello,

Can you please help me in the formula for IF statement.

I have a column with three numbers Column A = 30000; 27000; 23600

I want to make column out of this data using IF statement

like (IF(ColumnA=30000), "Megatruck", IF((ColumnA=27000), "standard", error))

Thank you in advance,

Sachin

7 Replies

Re: If statement

Looks like the brackets are wrong, maybe try something like this :

IF ( ColumnA=30000

, "Megatruck"

, IF ( ColumnA=27000

, "standard"

, error )

)

sachinnataraj
New Contributor II

Re: If statement

No it doesnt work

here is the formula from qlik sense

IF ( [Chargable weight/PTasab_cont_]=30000, "Megatruck", IF ( [Chargable weight/PTasab_cont_]=27000, "standard", "error" ))

It gives "megatruck","standard","error"is not valid

Re: If statement

Is you first field actually called

[Chargable weight/PTasab_cont_]


Or do you need to divide one field by another like this :


[Chargable weight] / [PTasab_cont_]


sachinnataraj
New Contributor II

Re: If statement

The field is called


[Chargable weight/PTasab_cont_]


its a column name

Re: If statement

In that case I don't know what is adrift, could you post full load statement from the script ?

Sometimes a typo elsewhere can cause an ok bit to error out.

sachinnataraj
New Contributor II

Re: If statement

Captura.PNG

From the column (chargable weight) which has numbers, I need to create a new column, it can be dimension od measure. Where i need to get or show 30000=megatruck, 27000 standard & 23400=  error.

I hope this helps

Re: If statement

Personally I would create a new field for it in the back end script.

Community Browser