Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
avneet85
Contributor

Set Analyis expression with null handling

Hi,

I want to create set analysis expression to show count as table heading . 

I have used below expression as measure in table and it works

count(

      if((isnull([ Year]) or [ Year]= $(vCurrent_FY)) and
          (isnull([Flag]) or [Flag]= '1') and
         [Master Flag]= '1' 
code)

 

I am trying to add same as table title and don't know how to add and handle null expression

='Table title'  & Num(Count({< [Master Flag] = {'1'},
[Flag]= {'1'}>} Distinct [Code]), '# ##0' )

 

1 Reply

Re: Set Analyis expression with null handling

Why don't you create a new flag in the script like this

If(Len(Trim(Year)) = 0 or Year = '$(vCurrent_FY)', 1, 0) as YearFlag,
If(Len(Trim(Flag)) = 0 or Flag = 1, 1, 0) as FlagFlag,

and then use it in your expression

='Table title' & 
Num(
Count({<[Master Flag] = {'1'}, [FlagFlag] = {'1'}, YearFlag = {'1'}>} DISTINCT [Code])
, '# ##0' )