Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Thierno
Contributor III
Contributor III

How to filter data on the previous week?

Hi everyone !


I solicit your help because it's been over a week that I use Qlik and I have a lot of trouble with the syntax of set analysis. I can not filter my data (which runs from August 2017 to today) weekly.

My goal is to show the sum of the numbers only from last week. Here is the last iteration of my work:

Sum ({$ <semaine = {"= $ (= week (weekstart (today (), -1, first_week_day = 0)))"}>} etat_ok)

"semaine" is a column containing the number of the week (0 -> 53)

Can you tell me what's wrong? Or maybe point me to a document explaining how set analysis works ? or both ?

1 Solution

Accepted Solutions
alexandrakfcosta
Contributor III
Contributor III

Hi Thierno,

I just realized that you are using 2 equal signs "=". I should try this way:

Sum({$<semaine = {"$(=Week(WeekStart(Today(), -1, 0)))"}>} etat_ok)

Best,

Alexandra.

View solution in original post

5 Replies
alexandrakfcosta
Contributor III
Contributor III

Hi,

I think your formula is correct, the only detail is regarding your third parameter on WeekStart function. Instead of using "first_week_day = 0", try to use just the value "0".

The final expression should be something like this:

Sum({$ <semaine = {"= $(=Week(WeekStart(Today(), -1, 0)))"}>} etat_ok)

I hope I could help.

Best,

Alexandra Costa.

Thierno
Contributor III
Contributor III
Author

Hi Alexandra,

tx for responding me,

i tried it but it like it doesn't make the filter.

see :

Capture 2.PNGalexandrakfcosta

Maybe there is something i misunderstand.

Best,

Thierno DIALLO

alexandrakfcosta
Contributor III
Contributor III

Hi Thierno,

I just realized that you are using 2 equal signs "=". I should try this way:

Sum({$<semaine = {"$(=Week(WeekStart(Today(), -1, 0)))"}>} etat_ok)

Best,

Alexandra.

MK9885
Master II
Master II

Maybe try....


Sum ({$ <Week = {$(=Max(Week)-1)},Date>} etat_ok)


Your Week field should be numeric like 1, ,2 ,3 ....

And use your date field as well.

Thierno
Contributor III
Contributor III
Author

Thanks you all for your help. i had an equal sign more.

Best wishes

Thierno