Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Whats wrong in this count and if expression ?

Expression for 0-1:

=count(if(Status='Open' and [As On Date]-[Commissioning Date]<2 ,Status='Closed' and [Closure Date]-[Commissioning Date]<2, [WQMS ID]))

Dimension Status has 2 values 'Open' and 'Closed' .

Obtained Result  :

Status0-1
Closed1
Open6

Desired Result:

Status0-1
Closed1
Open2

Data :

Commissioning Date As On Date WQMS ID Closure DateDiffStatus
4/3/20134/5/20131001 2Open
4/2/20134/5/20131002 3Open
4/1/20134/5/20131003 4Open
4/3/20134/5/20131004 2Open
4/4/20134/5/20131005 1Open
4/4/20134/5/20131006 1Open
4/3/20134/5/201310074/4/20131Closed
1 Reply
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this

=  if(Status='Open',

          Count(if([As On Date]-[Commissioning Date]<2 ,[WQMS ID])),

     if(Status='Closed', 

          count(if( [Closure Date]-[Commissioning Date]<2 ,[WQMS ID]))))   

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!