Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
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
Partner
Partner

Re: How to use Between function in Qliksense

Try:

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

View solution in original post

7 Replies
Partner
Partner

Re: How to use Between function in Qliksense

Try:

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

View solution in original post

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])

Partner
Partner

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?

Highlighted
Partner
Partner

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.