Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Greater Than Date

Hi,

I am trying to compare the dates and get a sum like

Sum my field where Activity_Date is greater than Assignment_Start_Date and it is giving me the same value as Sum(FieldName).

Please help with the syntax as I am missing something...

=Count({<Activity_Date={">=$(Assignment_Start_Date)"}>}FieldName)

13 Replies
Not applicable
Author

=Count({<Activity_Date={">=$(=max(Assignment_Start_Date))"}>}FieldName)

is working fine now. There was a difference in my date formats so now they are the same and is working like a charm...

Not applicable
Author

Have a twist to this .. The below code works if one employee is selected and gives zero when grid is allowed to display all employees.

What is missing now?

=Count({<Activity_Date={">=$(=max(Assignment_Start_Date))"}>}FieldName)

Josh_Good
Employee
Employee

Faiq,

I believe this is because the set analysis is being applied to the entire data set when you actually need it to apply for each employee in the grid.  To do this you will need use the AGGR function. Below I've guest at the correct expression. If what I posted doesn't work please post a sample QVW so we can work it out for you.

=sum(Aggr(Count({<Activity_Date={">=$(=max(Assignment_Start_Date))"}>}FieldName),Employee))

-Josh

Qlik

Not applicable
Author

Thanks for looking into Josh. I tried a simple If statement and is working now. Will let you know if more errors appear in testing

=Count(if(Activity_Date>=Assignment_Start_Date, Activity_GUID))