Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate a count from the most recent week of data. I am able to accomplish this by hard coding the following expression:
count({$ <ReportingWeekStart={'4/24/2016'} >} Account)
I define a variable
vSelectionWeekStart = date(WeekStart(max(ReportingDate)))
and display the variable in a text box to make sure it is working...so it displays as "4/24/2016"
however, this expression below returns a count of the entire current selection, not just the most recent week:
count({$ <ReportingWeekStart={"=$(=vSelectionWeekStart)"} >} Account)
What is wrong?
I guess what you need is to replace 4/24/2016 with an expression. To do that first step is to get the variable to expand to a correct number in a text box object. In your case, I am guessing that if you put $(vSelectionWeekStart) in a text box object you will see 04/24/2016. I just moved that within the dollar sign expansion -> $(=Whatever works in text box)
Maybe try
count({$ <ReportingWeekStart={'$(vSelectionWeekStart)'} >} Account)
Or
count({$ <ReportingWeekStart={'$(=vSelectionWeekStart)'} >} Account)
Try this:
Count({$<ReportingWeekStart={'$(=vSelectionWeekStart)'}>} Account)
or
Count({$<ReportingWeekStart={'$(=$(vSelectionWeekStart))'}>} Account)
it appears the second one works:
Count({$<ReportingWeekStart={'$(=$(vSelectionWeekStart))'}>}
the first does not. now, if only I understood why? I have a few others like this on the same report...will see how it goes.
I guess what you need is to replace 4/24/2016 with an expression. To do that first step is to get the variable to expand to a correct number in a text box object. In your case, I am guessing that if you put $(vSelectionWeekStart) in a text box object you will see 04/24/2016. I just moved that within the dollar sign expansion -> $(=Whatever works in text box)