Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous week data based on field


Hello,

I'm having trouble setting up a chart in QlikView to display data based only on the past week from a specific field. Should this be setup in the expression of the chart or in the QlikView load script? If so what is the syntax? Thank you!

8 Replies
its_anandrjs

Hi,

Provide some data for this will be more easy and fast.

Regards

Anand

Not applicable
Author

I have this in the expression of the bar chart but I need to limit it where Official Date is within the past 7 days based on today(). How could I set this up in the expression?

Count

([Type of Change])


its_anandrjs

Hi,

In the expression you can try

Count (if( Date = Date((Today()-7),'MM/DD/YYYY'), [Type of Change]))

Regards

Anand

Not applicable
Author

That worked, I just added >= too set it to a range for the past 7 days. How can I alter this expresion to be based off of specific days of the week? So for example to show the past week of data (Monday-Friday) changing to the next week on the following Friday?

its_anandrjs

Hi,

For dynamically load the past 7 days data back from current date then use this SET expression

Ex:-

Sum({< Date = {'>=$(=Date((Today()-7),'MM/DD/YYYY'))'} >}   Metrics )

Regards,

Anand

its_anandrjs

Hi,

For every week from Monday to Saturday values try this expression

Ex:-

Sum({<Date = {'>=$(=WeekStart( Today())) <=$(=Date(WeekEnd( Today())-2))'} >}   Sales)

For MON and SAT records and this is dynamic also

Mon-Sat.PNG

Regards

Anand

Not applicable
Author

Does this expression just get placed in the chart expression?  If so where does my count of [type of change] fit into the equation?

Agis-Kalogiannis
Employee
Employee

You can always use your count([type of change]) instead the sum(Sales) with the same set analysis expression Lindsay

count({<Date = {'>=$(=WeekStart( Today())) <=$(=Date(WeekEnd( Today())-2))'} >}[type of change])


or


count({<Date = {'>=$(=Date((Today()-7),'MM/DD/YYYY'))'} >}[type of change])