Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I've got a problem that seems too simple to solve but I can't find the solution online, perhaps due to wording.
I'm trying to add two custom variables to a Date field to create a Range of Dates.
This creates the following effective Formula:
However, I believe this does not create the desired outcome, as I beleive the two BUDAT filters aim to compliment eachother. Based on excess values I receive for this KPI, I believe this combination of filters automaticaly selects all Data. Is there a different way use multipe filters, maybe with an "and" instead of commas?
Thanks in advance!
try this:
sum({$<[BUDAT]={$(vPeriodMin)}> * $<[BUDAT]={$(vPeriodMax)}, [BLDAT]={$(vMinDate)}>} WTGBTR)
Regards,
Aditya
try this:
sum({$<[BUDAT]={$(vPeriodMin)}> * $<[BUDAT]={$(vPeriodMax)}, [BLDAT]={$(vMinDate)}>} WTGBTR)
Regards,
Aditya
Try it in this way:
sum({$<[BUDAT]={">=$(vPeriodMin)<=$(vPeriodMax)"}, [BLDAT]={$(vMinDate)}>} WTGBTR)
by excluding the comparing-operators from the variable.
How would it look if I wanted to apply two ranges? Say:
Sum({$<[BUDAT]={$(vPeriodMin)}, [BUDAT]={$(vPeriodMax)},
[BLDAT]={$(vPeriodMin)}, [BLDAT]={$(vPeriodMax)}>}WTGBTR)
I never tried an approach like:
Sum({$<[BUDAT]={$(vPeriodMin)}, [BUDAT]={$(vPeriodMax)}>}WTGBTR)
which might logically be functional by comparing against >= <= ranges. It would be depending if the selection-engine combined both AND linked sets or applied them in an order.
Even if there are possibilities to apply the wanted conditions in this way I wouldn't go in this direction else using a field only once within a single set-part because like above shown it's possible to define several values and/or ranges against a single field. Therefore I would use:
sum({$<[BUDAT]={">=$(vPeriodMin)<=$(vPeriodMax)"},
[BLDAT]={">=$(vPeriodMin)<=$(vPeriodMax)"}>} WTGBTR)
Unfortunatley, your solution above gives me the following error message:
For reference, my variables are now built like this:
I think it's caused from the way how the variables are created and that they itself contain quotes. Quotes within variables are possible but creating and calling them in the wanted context in the right way could become quite tricky. Further, concatenating strings or numbers with further numbers will create a string regardless how the result may look like.
I suggest to skip all these troubles and efforts and to apply all kind of matching and calculating only against pure numbers which may in regard to your first variable be something like this:
floor(makedate($(vMinYear), 1, 1))
As dimensions and selections it's fine to use strings or formatted numbers but they have serious disadvantages within any kind of an evaluation. And duplicating all necessary period-fields in n versions within a master-calendar is quite easy and will simplify the life a lot.