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

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

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)

Anil_Babu_Samineni

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)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful