Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Not applicable

Get a count from values between a certain range

Dear all,

I have the following data that I would like to load

LOAD * INLINE [
DATE, WEEKIN
2012-02-02, 2
2012-02-02, 3
2012-02-02, 4
2012-02-04, 4
2012-02-06, 6
]
;

And I have set the following variables:

set vDate1 = "2012-02-02";
set vDate2 = "2012-02-04";

I would  like to create a graph that shows the count of the values between date1 and date2. So therefore I created a graph with the following expression

count(<DATE={'>=$(vDate1) <=$vDate2)'}>}[WEEKIN]

But this gives me an error. Any thoughts on where I go wrong?

Tags (1)
1 Solution

Accepted Solutions

Re: Get a count from values between a certain range

Perhaps this?

count({<DATE = {'>=$(vDate1) <=$(vDate2)'}>}[WEEKIN])


Attached

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

6 Replies

Re: Get a count from values between a certain range

Perhaps this?

count({<DATE = {'>=$(vDate1) <=$(vDate2)'}>}[WEEKIN])


Attached

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

Re: Get a count from values between a certain range

What error are you getting?

Not applicable

Re: Get a count from values between a certain range

Hi Anil,

Thanks. For your reply. I am getting a graph now but the count seems to be wrong... I get a count of 5 now. While only 4 values fit the criteria.... Any thoughts?

Re: Get a count from values between a certain range

Yes, Because your data has 3 times for vdate1. If you want to show values of Count, you can use Values on Data Points

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
vinieme12
Esteemed Contributor II

Re: Get a count from values between a certain range

Can you give a screenshot of what you are looking at or your own sample qvw? the expression above by Anil should give you the correct result.

Not applicable

Re: Get a count from values between a certain range

I already solved it! Thanks for your input guys!