Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Creator
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
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

View solution in original post

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
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
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

View solution in original post