Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to change straight table to point only to current day selections?

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.


4 Replies
senpradip007
Specialist III
Specialist III

Try to create a trigger at Open Document as Date = Max(Date).

jonathandienst
Partner - Champion III
Partner - Champion III

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)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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)



Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks.