Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
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

Re: If statement help please

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

Re: If statement help please

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

Re: If statement help please

Sorry I need or instead of and

Not applicable

Re: If statement help please

Sorry I need or instead of and

Chanty4u
Esteemed Contributor III

Re: If statement help please

i think that "0" shud nt be there

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

          IF([RoomTypeAssigned]='WRKST',

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

Re: If statement help please

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

Re: If statement help please

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

Re: If statement help please

awesome.Thank you as always.