16 Replies Latest reply: Oct 17, 2016 1:33 PM by Sunny Talwar

# Condition on Dimension

Dear All,

I have a dimension Doctor.

I am using it as a filter.

Conditions:-

1.) If i don,t select any year then need to show doctors for current year .

2.) otherwise according to the years selections.

Like

Doctor     Year                         Revenue

Sunny      2014,2015 ,2016        455667

Manish    2014, 2015                 467787

Arjun       2014, 2015 ,2016        454767

Jagan      2015                           754344

Mohit       2014                            4577

By default 2 doctors will be present in the List box only Sunny And Arjun.

If i selected 2015 then Manish and Sunny and Arjun, Jagan will be in List box.

And if i selected 2014 then All except jagan.

Regards,

Mohit Dahiya

• ###### Re: Condition on Dimension

Please find the attached Sample data. ! !

• ###### Re: Condition on Dimension

use this as list box expression

=Aggr(Concat({<Year = {"\$(=Max(Year))"}>}DISTINCT Doctor,','),Doctor)

or

=Aggr(IF(GetSelectedCount(Year) = 0,

IF(Match(Doctor, \$(=CHR(39)& Concat({<Year = {'\$(=Max({1}Year))'}>}DISTINCT Doctor,CHR(39)& ',' & CHR(39)) & CHR(39))),Doctor),

Doctor),Doctor,Year)

• ###### Re: Condition on Dimension

Not Working Sir.

• ###### Re: Condition on Dimension

List box expression means you have to create list box using this expression.

This is working on my qliksense..

• ###### Re: Condition on Dimension

Can you check here

• ###### Re: Condition on Dimension

Sunny Bhai in Full form

• ###### Re: Condition on Dimension

Mohit -

Did you check that I used the same exact expression I gave you on the other post? I just copy and pasted. I am not sure why did you think it was not working? Can you clarify what you were doing differently?

Thanks,

Sunny

• ###### Re: Condition on Dimension

Don't Know bro. then i think i was using something wrong there.

• ###### Re: Condition on Dimension

Sunny bro one problem is here i am unable to select two Doctors at a time and for date and month it is not working

• ###### Re: Condition on Dimension

You are unable to select 2 doctors?

• ###### Re: Condition on Dimension

Yes bro i am unable to select 2 doctors

• ###### Re: Condition on Dimension

And this data is available only when i am selecting year i.  I need according to months and days also in same condition.

• ###### Re: Condition on Dimension

Well I guess follow the same logic (as we did for years). For selecting two values, try this slight modifaction

Aggr(Only({1<Year = {"\$(=If(GetSelectedCount(Year) = 0, Max({1}Year), Max(Year)))"}>}Doctor), Doctor)

• ###### Re: Condition on Dimension

But Bro when i select any date it is showing nothing see.

• ###### Re: Condition on Dimension

All things working fine but when i selecting for a proper date it is not working

• ###### Re: Condition on Dimension

I am not sure how date is related to that chart brother? I have only been helping you with a list box object for doctors. I have no idea where did date and those object came in from