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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If statement help please

IF(Seats-((count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                           +

      count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) = 0     and if(count(UniqueAB2Key)=0 ,  

SUM([AB1OccupancyCount(Manual)])),

             

Seats-((count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

        count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) )

I have the above expression and Once I add 'and if(count(UniqueAB2Key)=0 ' it throws me error.

How can I put that and statement for the first part?

Thank you very much.

1 Solution

Accepted Solutions
sunny_talwar

Then replace and with or

IF(Seats-((

  count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

      count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) = 0 or count(UniqueAB2Key)=0,

SUM([AB1OccupancyCount(Manual)])),

           

Seats-((count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

        count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) )

View solution in original post

7 Replies
sunny_talwar

May be try this:

IF(Seats-((

  count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                           +

      count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) = 0     and count(UniqueAB2Key)=0, 

SUM([AB1OccupancyCount(Manual)])),

            

Seats-((count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

        count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) )

Not applicable
Author

Sorry I need or instead of and

Not applicable
Author

Sorry I need or instead of and

Chanty4u
MVP
MVP

i think that "0" shud nt be there

count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) = 0    and if(count(UniqueAB2Key)=0

sunny_talwar

Then replace and with or

IF(Seats-((

  count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

      count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) = 0 or count(UniqueAB2Key)=0,

SUM([AB1OccupancyCount(Manual)])),

           

Seats-((count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='OFFICE',

              UniqueAB2Key)))

                          +

        count(if(len([EM EmpName])=0,

          IF([RoomTypeAssigned]='WRKST',

              UniqueAB2Key))))) )

sunny_talwar

You can also try this:

=If((Seats - Count({<[EM EmpName] -= {'*'}>}, [RoomTypeAssigned]= {'OFFICE', 'WRKST'}>} UniqueAB2Key)) = 0 or count(UniqueAB2Key) = 0,

(Seats - Count({<[EM EmpName] -= {'*'}>}, [RoomTypeAssigned]= {'OFFICE', 'WRKST'}>} UniqueAB2Key)))

Not applicable
Author

awesome.Thank you as always.