# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for
Did you mean:
Highlighted
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
Highlighted
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
Highlighted
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
Highlighted
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
Highlighted
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?

Highlighted
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