# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for
Did you mean:
Creator

## IF and AND Statement

Hi,

I have an error within my expression, any idea how to correct please?

if(match(Year = '2018' and Type = 'New'), '0.48',
if(match(Year = '2019' and Type = 'Used'), '0.33',
if(match(Year = '2018' and Type = 'New'), '0.52',
if(match(Year = '2019' and Type = 'Used'), '0.66'))))

Thanks

1 Solution

Accepted Solutions
Partner

Why are you using match()? Match takes two parameters.

Try this:

if((Year = '2018' and Type = 'New'), '0.48',
if((Year = '2019' and Type = 'Used'), '0.33',
if((Year = '2018' and Type = 'New'), '0.52',
if((Year = '2019' and Type = 'Used'), '0.66')
)
)
)

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
4 Replies
I think you mean if(match(Year = '2018') and Type = 'New', '0.48', if(match(Year = '2019') and Type = 'Used', '0.33', if(match(Year = '2018') and Type = 'New', '0.52', if(match(Year = '2019') and Type = 'Used'), '0.66')))
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Sorry the format options are missing and the white spaces are being ignored
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Creator

Thanks for the suggestion but the logic doesn't appear to work. I'm not too sure what is meant by your latest comment, sorry?

Partner

Why are you using match()? Match takes two parameters.

Try this:

if((Year = '2018' and Type = 'New'), '0.48',
if((Year = '2019' and Type = 'Used'), '0.33',
if((Year = '2018' and Type = 'New'), '0.52',
if((Year = '2019' and Type = 'Used'), '0.66')
)
)
)

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Tags