Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I convert if condition into set analysis



[

IF (Enrollment.expStartDate = Date(Today() ) and Enrollment.sySchoolStatusID =5 ,Count(Enrollment.syStudentID)
/
IF(Enrollment.expStartDate = Date(Today() ),Count(Enrollment.syStudentID)





]

Above if condition is not working . I would like to know the correct way to resolve it either by if condition or through set analysis.

Thanks.





6 Replies
Not applicable
Author

Count(if(Enrollment.expStartDate = Date(Today() ) and Enrollment.sySchoolStatusID =5 ,Enrollment.syStudentID)

/Count(IF(Enrollment.expStartDate = Date(Today() ),Enrollment.syStudentID))



Please try above .

Miguel_Angel_Baeyens

With Set Analysis it should look like this:

Count({< Enrollment.expStartDate = {'$(=Date(Today()))'}, Enrollment.sySchoolStatusID = {5} >} Enrollment.syStudentID) / Count({< Enrollment.expStartDate = {'$(=Date(Today()))'} >} Enrollment.syStudentID)


Hope that helps

Not applicable
Author

Thanks . But I think I have another problem may be in script or declaring dimension.

Please , see the attachment accepted.qvw

Thanks in advance.

Not applicable
Author

Thanks . I am newbie to qlikview .But I think there is something wrong with my script or declaring dimension in chart

I have attached the accepted.qvw

Please take a look and correct me .

Thanks .

Not applicable
Author

Thanks Miguel . I am newbie to qlikview. But I think there is something wrong in my script or declaring dimension.

Please take a look to attachment accepted.qvw and please correct me with explaination.

Thanks.

Miguel_Angel_Baeyens

Hello,

The application you posted doesn't have any record with sySchoolStatusID = 5, so no data will be displayed. Besides, your date format should be easier to manage adding in your script

Date(Enrollment.expStartDate) AS Enrollment.expStartDate,


You are qualifying all fields. That will prevent QlikView of associating fields. Did you do that on purpose?

Not having the script nor access to some real or dummy data, it's difficult to go further.

Regards.