Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
in my data I have several tables where I need to calculate meassures for both Interval between two dates and dates as events.
For example I need to calculate how many new customers registered on a given date, and how many registered customers I had on that date.
In the sample data, I have a Master Calendar and make an IntervalMatch between the Registration_Start and Registration_End Fields.
Then I use the expression:
= count(ID)
for counting registered customers (interval).
And the set expression:
= if(isnull(getfieldselections(Date)),Count(ID), Count({$<[Registration_Start] = Date>} ID))
for counting new registration (event).
Now this works fine, If i filter by a single (master)date. But if I filter by (master)month the expression for events fails.
For example if I select all dates from 5.2013 I get the right count of registrations = 7.
But if I select just month = 5, and year = 2013, the set expression won't get linked to the date and I get a wrong count of registrations = 12.
Do i need to write set expression for all master calendar fields or is there a simpler way to get to the right numberr?
Thanks for any tips!
Jakub
See attached qvw
Thanks a lot!
The code:
=if(GetPossibleCount(Date),Count(distinct if(Registration_Start=Date,ID)),count(ID))
seems to do the job well.
Just out of my couriosity, in which case would the "then" part of the first if (count(ID)) come into action?
It seemes to work without it, as much as I tested it.
J.