Forum Discussion
Concatenate Expression with If Statement (Report Builder)
- Anonymous5 years ago
Hello,
After some further trial and error was able to figure it out. Thanks so much for the help!=IF(Fields!Period.Value = "Yesterday",
Fields!Period.Value & " " & Fields!Period_Date.Value,
Fields!Period.Value & " " & Min(Fields!Period_Date.Value) & "-" & Max(Fields!Period_Date.Value)
)
Hi, Anonymous
You seem to be missing a few parentheses. You can try this:
=IF(Count(Fields!Period_Date.Value) >1, Min(Fields!Period_Date.Value) & "-" & Max(Fields!Period_Date.Value), Fields!Period_Date.Value)
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Janey! Thanks for recommendation, although it wasn't quite what I'm looking for. With that expression, I get the following:
In Yesterday Column: 6/27/2021 - 6/27/2021
MTD Column: 6/1/2021 - 6-28-2021
YTD Column: 1/1/2021 - 6/28/2021
What I am trying to get is the following
Yesterday Column: Period Value "Yesterday" Period Date Value"6/27/2021"
MTD Column: Period Value "Month to Date" Min and Max Period Date Values "6/1/2021 - 6/28/2021"
YTD Column: Period Value "Year to Date" Min and Max Period Date Values "1/1/2021 - 6/28/2021"
I'm sure its just a syntactical issue, but I can't quite seem to work out the kinks. Here is what I'm trying to use now.
=IF(Fields!Period.Value) <> "Yesterday",
(Fields!Period.Value & " " & (Min(Fields!Period_Date.Value) & "-" & Max(Fields!Period_Date.Value))),
(Fields!Period.Value & " " & Min(Fields!Period_Date.Value))
- Anonymous5 years agoNot applicable
Hello,
After some further trial and error was able to figure it out. Thanks so much for the help!=IF(Fields!Period.Value = "Yesterday",
Fields!Period.Value & " " & Fields!Period_Date.Value,
Fields!Period.Value & " " & Min(Fields!Period_Date.Value) & "-" & Max(Fields!Period_Date.Value)
)