If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
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?
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)
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.
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)
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?
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.