Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have straight which loads data every day. when user logged and want to see current day information user is seeing all old data instead of only current day. so, I need to change the straight table only to current day data.
user is not interested to select current date every time.
dim1: stage
dim2: re
expression1: only(name)
expression2: only(datafine)
can anyone suggest me how to do this?
Thanks.
Try to create a trigger at Open Document as Date = Max(Date).
Modify the expressions to use the selections:
only({<Date = {"$(=Date(Max(tDate)))"}>} name)
only({<Date = {"$(=Date(Max(tDate)))"}>} datafine)
If no date is selected, this will be the most recent date in your model, otherwise it will be the selected date.
If your model has future dates and you want to default to today's date, then change the set expressions to:
<Date = {"$(=If(GetSelectedCount(tDate) > 0, Date(Max(tDate), Today())))"}>
(change the field name tDate to the correct name for your model)
You can put this date expression into a globally evaluated variable, like this:
Set vMaxDate = =Date(Max(tDate)); // the "= =" is not a typo
or
Set vMaxDate = =If(GetSelectedCount(Date) > 0, Date(Max(Date), Today()));
Now your complete expression:
only({<Date = {'$(vMaxDate)'}>} name)
Thanks.