Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
iliaisyah
Contributor III
Contributor III

If Question

Im using the expression as below

= If(PlantingMaterial='Socfindo',95) and its works

but i want to add, if other = 100

 

how to add the expression for that

total expression is if planting material is socfindo, score = 95, is planting material other than socfindo, score is 100

2 Solutions

Accepted Solutions
pasi_lehtinen
Partner - Contributor III
Partner - Contributor III

= If(
    PlantingMaterial='Socfindo',
    95,
    if(
        PlantingMaterial='Other',
        100
    )
)

or

pick(match(PlantingMaterial,'Socfindo','Other'),95,100)

View solution in original post

sergio0592
Specialist III
Specialist III

Otherwise, you can use this syntax :

=pick(match(PlantingMaterial,'Socfindo')+1,100,95)

Here advantage is that it works even if you don't have  'other' value in your data.

View solution in original post

6 Replies
madhu_r
Partner - Contributor III
Partner - Contributor III

Hi,

Try this

= If(PlantingMaterial='Socfindo',95,If(PlantingMaterial='other',100))

Thanks & Regards,

Madhu

pasi_lehtinen
Partner - Contributor III
Partner - Contributor III

= If(
    PlantingMaterial='Socfindo',
    95,
    if(
        PlantingMaterial='Other',
        100
    )
)

or

pick(match(PlantingMaterial,'Socfindo','Other'),95,100)
iliaisyah
Contributor III
Contributor III
Author

Thank you it works!
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

iliaisyah don't for get to close the thread by checking the correct answer.
Thank you!
sergio0592
Specialist III
Specialist III

Otherwise, you can use this syntax :

=pick(match(PlantingMaterial,'Socfindo')+1,100,95)

Here advantage is that it works even if you don't have  'other' value in your data.

iliaisyah
Contributor III
Contributor III
Author

This also works!