# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Contributor

## Complex set analysis

Hi.

I have expression and want to convert same into to set analysis.

sum(if(
(isnull([ Fiscal Year]) or [Fiscal Year]= \$(vCFY)) and
(isnull([Range  flag]) or [Range flag]= '1') and
[Flag Status]= '1' and
[Master Flag]= 'Yes',1,0
)
)

Kindly suggest.

Thanks

2 Replies
Esteemed Contributor

## Re: Complex set analysis

Hi

try this

=sum({<([Fiscal Year]={"=Len(Trim([Fiscal Year]))=0"}> + <[Fiscal Year]={'\$(vCFY)'}) * ([Range  flag]={"=Len(Trim([Range  flag]))=0"}> + <[Range  flag]={1}>) * [Flag Status]={1} * [Master Flag]={'Yes'}>} 1) MVP

## Re: Complex set analysis

What is the reason you want to convert, I think this also more optimized one which you used. If you need in set analysis try this way, But To return 1 and 0 based on condition you must need If..Else condition in it.

Alt(Sum({<[Fiscal Year] = {"=Len([Fiscal Year])=0", "\$(vCFY)"}, [Range flag]={"=Len([Range flag])=0", "1"}, [Flag Status]={1}, [Master Flag] = {"Yes"}>} 1),0)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)