Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
YG
Contributor III
Contributor III

Qlik Sense - How to get between 2 numeric values in line a chart

Hi All,

I am trying to limit last 5 weeks data only for current year and past year same period.

I created 2 measures (Dynamic) 

CurWeekNo  and  Vweek

 

I tried rangemin(rangemax('CurWeekNo  ', -5), 1) // Didnt work

 

Pic.PNG

week.PNG

My requirement is to get above same chart but  Vweek BETWEEN CurWeekNo. Anyone can help would be appreciated. Thanks 

Labels (3)
2 Solutions

Accepted Solutions
_ylc
Partner - Creator
Partner - Creator

use this:

Count({<Week={">=$(=$(vCurrWeekNo)-$(vWeek))"}>} DISTINCT Incident_Number)

View solution in original post

_ylc
Partner - Creator
Partner - Creator

You should put it on your expression, not in the dimension.

Something like this:

ss.PNG

Edit:

- Above line chart is using the set analysis

- Below line chat is just sum(Value)

View solution in original post

6 Replies
Vegar
MVP
MVP

Try using set analysis to solve your issue. Something like this.

Count({< Week={">=$(CurWeekNo)-$(Vweek)"}>}distinct ID)

YG
Contributor III
Contributor III
Author

Hi Vegar,

I used it as,

=Count({< Week={">=$(CurWeekNo)-$(Vweek)"}>}distinct Incident_Number)

Then I tried,

=Count({< Week={">=$(CurWeekNo)-$(Vweek)"}>})

both coming up as invalid.  Not really sure where is the invalid part is in this

_ylc
Partner - Creator
Partner - Creator

use this:

Count({<Week={">=$(=$(vCurrWeekNo)-$(vWeek))"}>} DISTINCT Incident_Number)

YG
Contributor III
Contributor III
Author

Thanks for the reply _yls,

Still the its a "Invalid dimension"

I tried,

Count({<Week={">=$(=$(CurrWeekNo)-$(vWeek))"}>} DISTINCT Incident_Number)

Then,

=Num(Count({<Week={">=$(=$(CurrWeekNo)-$(vWeek))"}>} DISTINCT Incident_Number))

Mes.PNG

 

Also I tried totally different approach using -    Aggr( If( rank(Week)<6, Week), Week)  it came close but it goes to max Week number 53 but still I cant get it Currentweek number from this

 

aggr.PNG

I could be doing a mistake here I still cant figure it out.

 

_ylc
Partner - Creator
Partner - Creator

You should put it on your expression, not in the dimension.

Something like this:

ss.PNG

Edit:

- Above line chart is using the set analysis

- Below line chat is just sum(Value)

YG
Contributor III
Contributor III
Author

Awesome!! Work like a charm now. I sort of  knew I was doing something wrong not the expression you gave me. Thanks _ylc