Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 ?
here the right answer :
sum( {$<semaine ={"$(=week(weekstart( today(), -1, 0)))"}>} etat_ok )
maybe this:
=Sum( {< semaine = {"$(=week( weekstart(today()-7) ))"} >} etat_ok )
I hope it helps.
i tried it but it gives me this :
PS: it's a KPI
try to create a text box with this expression:
=week( weekstart(today()-7) ))
and check what you get.
the good writing is this : Week(WeekStart(Today(), -1, 0)), here the definition of weekStart you'll understand the function
The one you gave me return blank box.
But mine give me : 38 as the number of last week. that one is good.
The problem is when i add this thing to the sum. it doesn't do the filter at all.
See :
actually I get 38 as result using the expression I gave you.
in the script I have:
SET FirstWeekDay=6;
anyway the right syntax is:
semaine = {"$(=Week(WeekStart(Today(), -1, 0)) ) "}
oh tx, can you explain me what's the difference between my syntax and yours ?
in your syntax there is an equal sign more,
semaine = {"=$(=Week(WeekStart(Today(), -1, 0)) ) "}
remember to mark the correct answer if applicable, to help other community members.
here the right answer :
sum( {$<semaine ={"$(=week(weekstart( today(), -1, 0)))"}>} etat_ok )