Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeJones
Creator
Creator

Table showing the last 7 days data

Hi, I wish to have a table showing the last 7 days of data.

E.g. On 15th Feb, the table will show data for each day back to 8th Feb.

Tomorrow when I look at the table, the table will show data for each day back to 9th Feb.

Is there any way of doing this with the data in set analysis?

Labels (2)
2 Solutions

Accepted Solutions
rubenmarin

Hi, you can use set analysis, this creates a subset of data to calculate the expression.

If you expression is: Sum(Sales)

Using set analysis to filter a date field called DateField it could be: Sum({<DateField={">=$(=Date(Today()-7))"}>}Sales)

 

View solution in original post

rubenmarin

Hi, if you have more expressions you'll need to add the condition in each expression, maybe you also need to unchek the option in add-ons -> show zero values.

If you have date as dimension you can filter them with an if, not set analysis: If(DateField>=Today()-7,DateField) and uncheck the option to show null values. In this case you don't need to add the set analysis on the expressions.

View solution in original post

3 Replies
rubenmarin

Hi, you can use set analysis, this creates a subset of data to calculate the expression.

If you expression is: Sum(Sales)

Using set analysis to filter a date field called DateField it could be: Sum({<DateField={">=$(=Date(Today()-7))"}>}Sales)

 

MikeJones
Creator
Creator
Author

Thanks for your suggestion.  When I use your code, I still get a full data table, not just the last 7 days.

Is there a way to get the dimension to show just the last 7 days and then use your code?

rubenmarin

Hi, if you have more expressions you'll need to add the condition in each expression, maybe you also need to unchek the option in add-ons -> show zero values.

If you have date as dimension you can filter them with an if, not set analysis: If(DateField>=Today()-7,DateField) and uncheck the option to show null values. In this case you don't need to add the set analysis on the expressions.