Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
niharika1234
Creator
Creator

If Statement

Hello,

I am having trouble in finding Correct If else statements.  My Logic is if M-TYPE  is R or RE and M Status is populated then that column will be Closed Else Open . That means  If M-Status has no value or Null the field should be Open. I have tried following script but looks like some error. Please suggest.

if (M_Type = 'R') OR IF (MOR_Type = 'RE')and Len(M_STATUS)>0, ' Closed' Else 'Open',

5 Replies
sunny_talwar

Try this

If(Match(M_Type, 'R', 'RE') and Len(Trim(M_STATUS)) > 0, 'Closed', 'Open')

niharika1234
Creator
Creator
Author

Thanks a lot Sunny.

niharika1234
Creator
Creator
Author

Hello Sunny,

I tried your suggestion and part of results are incorrect . I believe the column has many - -  and that is causing Problem. The Logic is when when Incident type is R or RE and Mor-Category is populated, KPI should be closed. All other are Open.

Untitled.pngIf(Match(M_Type, 'R', 'RE') and Len(Trim(M_STATUS)) > 0, 'Closed', 'Open')



Thanks,

Niha

niharika1234
Creator
Creator
Author

Hello Sunny,

I tried your suggestion but Part of answer is incorrect. IUntitled.png

believe there are lot of _ that' s why it is . Logic is MOR_CATEGORY is Populated and Incident Type is R or RE , Closed and all other are Open. Please suggest.

Thanks,

Niha

sunny_talwar

Your field is not called M_STATUS and M_Type? May be use the correct fields...

If(Match([Incident Type], 'R', 'RE') and Len(Trim(MOR_CATEGORY)) > 0, 'Closed', 'Open')

or may be this

If(Match(Trim([Incident Type]), 'R', 'RE') and Len(Trim(MOR_CATEGORY)) > 0, 'Closed', 'Open')