Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
rvijayanth
Contributor

How to use Between function in Qliksense

I have a pivot table with distinct count of ID as a measure. I want to be able to count ID when its "Between" "From" and "To".

Whats the syntax for using between logic?

Will something like the following work?

Count({<[Year]={">$(vFrom)"} and [Year]={">=$(vTo)"}>} Distinct ID)???

1 Solution

Accepted Solutions
shraddha_g
Honored Contributor III

Re: How to use Between function in Qliksense

Try:

Count({<[Year]={">$(vFrom)<=$(vTo)"}>} Distinct ID)

7 Replies
shraddha_g
Honored Contributor III

Re: How to use Between function in Qliksense

Try:

Count({<[Year]={">$(vFrom)<=$(vTo)"}>} Distinct ID)

rvijayanth
Contributor

Re: How to use Between function in Qliksense

Thank you so much

rvijayanth
Contributor

Re: How to use Between function in Qliksense

One more question, what if I want to show the dimension in my pivot table as years but only years between 'from' and 'to' years?

Something like this????

if([Year]={">$(vFrom) and <=$(vTo)"}), [Year])

shraddha_g
Honored Contributor III

Re: How to use Between function in Qliksense

instead use set analysis in all expressions of Pivot table ({<[Year]={">$(vFrom)<=$(vTo)"}>}

and in Add Ons Section uncheck Show zero values.

It will restrict year in dimension according to values mentioned in set analysis

rvijayanth
Contributor

Re: How to use Between function in Qliksense

I want to use in dimension so that when users use the slider to set from and to values, the values show up as selections on the selection bar.

So please tell me if this can be used to restrict dimensions?

shraddha_g
Honored Contributor III

Re: How to use Between function in Qliksense

try

if([Year]>='$(vFrom)' and [Year]<='$(vTo)', [Year])

rvijayanth
Contributor

Re: How to use Between function in Qliksense

Thank you so much. This is what I want although I realize i like the expression on the count is better.