Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Formula

Hi All,

Can please someone explain me  how does this below formula works ? 

 

=if(if(Count(DISTINCT Department)=0,Count(DISTINCT [Sub Dept]),Count(DISTINCT Department))=1,1,0)

 

Thanks in Advance

Labels (1)
1 Solution

Accepted Solutions
zhadrakas
Specialist II
Specialist II

this should help

=if(
   if(Count(DISTINCT Department)=0, //0 Departments, then
       Count(DISTINCT [Sub Dept]),  //count distinct sub department, else
         Count(DISTINCT Department) //count distinct department
    )=1                             //check if result of inner if 1, then
      ,1                            //1, else 
       ,0)                          //0

 

View solution in original post

1 Reply
zhadrakas
Specialist II
Specialist II

this should help

=if(
   if(Count(DISTINCT Department)=0, //0 Departments, then
       Count(DISTINCT [Sub Dept]),  //count distinct sub department, else
         Count(DISTINCT Department) //count distinct department
    )=1                             //check if result of inner if 1, then
      ,1                            //1, else 
       ,0)                          //0