Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I'm trying to control the contents of a dimension with two date fields (using SimpleFieldSelect date items). The two date fields are connected to vDate1 and vDate2 variables.
In my app I have a Date dimension. There is date for every day for the last 3 years. My data model looks like:
DataTable |
---|
Date |
Customer |
Product |
Volume |
I only wish to display Date values that match the following:
- date from Date1
- date from Date2
- date from Date2 + 7 days
- date from Date 2 + 14 days
In my initial attempt I use:
=If(Date = Date(vDate1) or Date = Date(vDate2), Date)
This works the first time, that I select a date, but subsequent changes to the Date1 item, does not update the table.
Is it even possible to manipulate a dimension this way or should I consider another approach?
Thanks!
You're probably using the "=" operator inside the variable expression.
1. Take the operator out of the variable expression
2. Call the variables like:
=If(Date = Date($(vDate1)) or Date = Date($(vDate2)), Date)
Thanks for your reply.
I tried it, but it did not make much of a difference. The dimension is still not updated when I select a different date.
I am using this approach now and it seems to do the job:
=Aggr(
If(
Date = Date(vDate1)
or Date = Date(vDate2)
or Date = Date(Num(vDate2)+7)
or Date = Date(Num(vDate2)+14)
or Date = Date(Num(vDate2)+21)
or Date = Date(Num(vDate2)+28)
, Only(Date)), Date)