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

Set Analysis Help

Hi All, I need help on this below set analysis.

All I need is for few of the column I need to show "PASS" or "Fail" based on Metricvlaue .

If any of the value contains "Fail" I need to show "Fail" only.else remaining values. somehow it is not working.

  

if(count(

{<MetricName={'M1','M2','M3','M4'},

MetricIndexvlaue={'FAIL'},MetricIndexPeriod = {'$(=$(v_previous_month))'}>}Metricvlaue)>0,'Fail','PASS'),

sum({<MetricPeriod = {'$(=$(v_previous_month))'}>}Metricvlaue)

/count({$<MetricPlant-={'M6'}>}distinct MetricPlant)

5 Replies
Muthu
Partner - Creator III
Partner - Creator III

Please attach sample qvw.

Anonymous
Not applicable
Author

MetricID,Metricvalue,Matericperiod

M1,PASS,JUN2017

M1,PASS,MAY2017

M2,10,JUN2017

M2,20,MAY2017

M3,30,JUN2017

M3,40,MAY2017

M4,PASS,JUN2017

M4,FAIL,MAY2017

Here for M1 AND M4 need to show "fail" even if there is Fail.else "Pass". also sum(MetricValue) for remaining metricIDs

Hope this can give you idea

sunny_talwar

Your if condition ended here, what is the part in red below?

if(count(

{<MetricName={'M1','M2','M3','M4'},

MetricIndexvlaue={'FAIL'},MetricIndexPeriod = {'$(=$(v_previous_month))'}>}Metricvlaue)>0,'Fail','PASS'),

sum({<MetricPeriod = {'$(=$(v_previous_month))'}>}Metricvlaue)

/count({$<MetricPlant-={'M6'}>}distinct MetricPlant)

Anonymous
Not applicable
Author

Hi Sunny,

Its kind of MetricName-={'M1','M2','M3','M4'} Means am excluding the other Metrics. Because other metrics will have the numeric values

Anonymous
Not applicable
Author

Hi its my original expression

if(v_set_reset=0 and GetSelectedCount(MetricIndexPeriod)=0,

IF(count({<Pvt_MetricName={'M1','M2','M3','M4'},

MetricIndexvlaue={'FAIL'},MetricIndexPeriod = {'$(=$(v_previous_month))'}>}MetricIndexvlaue)>0,'Fail','PASS',

(sum({<MetricIndexYear = {'$(=$(v_previous_year))'}>}MetricIndexvlaue)/12

),IF((v_set_reset=1  or v_set_reset =0) and GetSelectedCount(MetricIndexPeriod)>0,

count({<Pvt_MetricName={'M1','M2','M3','M4'},

MetricIndexvlaue={'FAIL'},MetricIndexPeriod = {'$(=$(v_previous_month))'}>}MetricIndexvlaue)>0,'Fail','PASS'),sum(MetricIndexvlaue)))