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

Count with set analysis using another field

Hi,

I need to make a set analysis comparing 2 date fields inside on a set analysis operation, my actual expression it's something like this:

=count({$<Date1={>=Date2}, Type={'ReadOnly'}>} Event)

Its possible to restrict my set analysis to Date1 greater then Date 2 in this case?

2 Replies
Not applicable
Author

Hi Gabriel,

You cannot have two datamodel fields in comparison in set modifies like Date1>=Date2. where Date1 and Date2 are fields in datamodel. You either have to create comma seperated values from Date2 possible values and then put it in set analysis to work or have static values like '01/01/2014' etc.

You can use concat function like

concat(distinct Date2, ',') and write this in set analysis using $ sign expansion.

=count({$<Date1={">=$(=concat(distinct Date2, ','))"}, Type={'ReadOnly'}>} Event)

Hope this helps,

Anosh

Not applicable
Author

Not sure your exact requirements but assuming, date1 and date2 are static fields not selections, you may want to compare Date1 and Date2 in the load script and create a 3rd column like IsDate1GreaterThanDate2 and use it in your set analysis.