Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Not applicable

Show only data from the past 7 days

I want to show data from the past 7 days only.

I currently have

sum({<Date={">=$(WeekStart( Today()-7))<$(=today()))"},[Customer] = >}

date([Paid in full date])

-

date([Invoice date])

) / Count( {<Date={'>=$(WeekStart( Today()-7))'},[Customer] = >}Count)

But the above literally does nothing, its the same as if I didn't put in the time parameters. I tried testing the bottom  count(Count)

part to see if my date limitations even worked, and even just the bottom part doesn't change (17 records normally, still 17 after putting the limitation on).

Any ideas?

As you can see, the Average days to pay is the same in both scenarios. The top chart doesn't have the date limitations in the set expression.same2.png

1 Solution

Accepted Solutions
dwforest
Valued Contributor

Re: Show only data from the past 7 days

Your set expression needs to reference actual fields...

sum({<[Paid in full date]={">=$(=WeekStart( Today()-7))<$(=today())"},[Customer] = >}

date([Paid in full date])

-

date([Invoice date])

) / Count( {<[Invoice date]={'>=$(=WeekStart( Today()-7))'},[Customer] = >}Count)

12 Replies
antoniotiman
Honored Contributor III

Re: Show only data from the past 7 days

Date={">=$(=WeekStart( Today()-7))........

aarkay29
Valued Contributor

Re: Show only data from the past 7 days

Try This

sum({1<Date={">=$(=WeekStart( Today()-7))<$(=today())"},[Customer] = >}

date([Paid in full date])

-

date([Invoice date])

) / Count( {1<Date={'>=$(=WeekStart( Today()-7))'},[Customer] = >}Count)

Not applicable

Re: Show only data from the past 7 days

sadly didn't work code.png

Also, it has been red underlined this whole time but it says expression OK at the top

Re: Show only data from the past 7 days

try this

sum({<Date={">=$(=WeekStart( Today()-7))<$(=today())"},[Customer] = >}

date([Paid in full date])

-

date([Invoice date])

) / Count( {<Date={'>=$(=WeekStart( Today()-7))'},[Customer] = >}Count)

Not applicable

Re: Show only data from the past 7 days

It didn't work says expression OK, but all the code is underlined red (it was before as well), and no difference in the chart.

Not applicable

Re: Show only data from the past 7 days

It didn't work says expression OK, but all the code is underlined red (it was red before as well), and no difference in the chart.

Re: Show only data from the past 7 days

Please check your Date field name. It's name is really "Date". Looks ike this date field is not available in your model

Not applicable

Re: Show only data from the past 7 days

What do you mean date field? I don't have a date table in my code, I am subtracting the Paid in full date from Invoice date, both which are tables in my code

dwforest
Valued Contributor

Re: Show only data from the past 7 days

Your set expression needs to reference actual fields...

sum({<[Paid in full date]={">=$(=WeekStart( Today()-7))<$(=today())"},[Customer] = >}

date([Paid in full date])

-

date([Invoice date])

) / Count( {<[Invoice date]={'>=$(=WeekStart( Today()-7))'},[Customer] = >}Count)