New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for
Did you mean:
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

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

Labels (3)

• Qlik Sense

2 Solutions

Accepted Solutions
Partner

use this:

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

Partner

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

Something like this:

Edit:

- Above line chart is using the set analysis

- Below line chat is just sum(Value)

6 Replies
MVP

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

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

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
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

Partner

use this:

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

Contributor III
Author

Still the its a "Invalid dimension"

I tried,

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

Then,

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

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

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

Partner

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

Something like this:

Edit:

- Above line chart is using the set analysis

- Below line chat is just sum(Value)

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

Tags
Community Browser