Skip to main content

New to Qlik Sense

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

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
kumarkp412
Creator II
Creator II

Conditional filter in Qliksense

Dear All,

I want to create a filter called branch and it should show the names as per the current year how many branches are there .

When i try to create a condition filter, it was throw me an error and it says as invalid dimension.

for I uses as

only({<year='2017'>}branch).

I was strucks here .Can you one help on this , it would be appreciated.

Thanks in advance

Thanks

Kumar KVP

1 Solution

Accepted Solutions
sunny_talwar

May be try this

If(year = 2017, branch)

or this

Aggr(Only({1<year = {2017}>} branch), branch)

View solution in original post

8 Replies
sunny_talwar

May be try this

If(year = 2017, branch)

or this

Aggr(Only({1<year = {2017}>} branch), branch)

shraddha_g
Partner - Master III
Partner - Master III

Try

Only({<year = {'2017'}>}branch)

mark6505
Partner - Master
Partner - Master

HI

I think the first suggestion by Sunny has suggested is what your looking for.

IF(year=2017, branch)

Only() function is used when your set analysis will only ever return a single value, the error is occurring as you will have multiple branches in your data with the year of 2017, so it doesn't know which one to return.

Mark

Chanty4u
MVP
MVP

try like this

aggr(Only({<year = {'2017'}>}branch),branch)

kumarkp412
Creator II
Creator II
Author

Hi Sunny,

Thanks for your reply.

I tried with the if condition what you mentioned. It was selecting entire data as 2017. I didnt need this.

I want only this branch filter should show the current year possible value of branches in it.

Also when i try with having the only function it was throw as invalid error.

Thanks in advance

Thanks

Kumar KVP

shraddha_g
Partner - Master III
Partner - Master III

Share sample app

Solutions provided by Sunny should work..

martinpohl
Partner - Master
Partner - Master

you need to calculate the condition for each value, so aggr is needed.

use

=aggr(only({1<year={'2017'}>}branch),branch)

Regards

kumarkp412
Creator II
Creator II
Author

Thanks Sunny,

It was working fine when i uses the second expression.

Thanks

Kumar KVP