Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

if logic

Hi Experts,

Can any one please help me on below if logic.

I have 3 fields named Quality status,Ethics status and compliance status like below.Subsection RAG is the calulated Field.

If one Amber present in the quality,ethics and compliance status fields then Subsection Rag is Amber,

If one Red present in the quality,ethics and compliance status fields then Subsection Rag is Red.


I need to create the subsection RAG field with this logic on backend only.

Thanks in advance.

1 Solution

Accepted Solutions
Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

if([Quality Status] = 'Red' or [Ethics] = 'Red' or [Compliance Status] = 'Red','Red',

if([Quality Status] = 'Amber' or [Ethics] = 'Amber' or [Compliance Status] = 'Amber','Amber')) as [sub-section RAG]

View solution in original post

3 Replies
sunny_talwar

May be this

If(SubStringCount('|' & [Quality Status] & '|' & [Ethics Status] & '|' & [Compliance Status], '|Red|') > 0, 'Red',

If(SubStringCount('|' & [Quality Status] & '|' & [Ethics Status] & '|' & [Compliance Status], '|Amber|') > 0, 'Amber', 'Green')) as [Sub-section RAG]

Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

if([Quality Status] = 'Red' or [Ethics] = 'Red' or [Compliance Status] = 'Red','Red',

if([Quality Status] = 'Amber' or [Ethics] = 'Amber' or [Compliance Status] = 'Amber','Amber')) as [sub-section RAG]

amarnath_krishn
Contributor III
Contributor III

Decode the values to Numbers:

Amber = 2

Red = 0

Green = 1

For Subsection RAG,

Multiply the three and if the result is

1 - Green

0 - Red

Else Amber

Hope it works!