Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
qlikwiz123
Contributor

Set Analysis to show field values based on condition

I want to show Field Values based on Conditions/Filters. I can use 'if', but the filters have to be manually selected in order for the values to be filtered. I need something like Set Analysis that doesn't change with other filters but show the values defined within the Expression.

if(FieldA='A', FieldB='B', FieldC)

In this case, the user needs to select 'A' in FieldA and 'B' in FieldB. I need the table to show only those values in FieldC that satisfies FieldA=A and FieldB=B all the time; something like Set Analysis but without Numeric Operators like Sum or Count?

1 Solution

Accepted Solutions
Khan_Mohammed
Honored Contributor II

Re: Set Analysis to show field values based on condition

Maybe

Only({1<FieldA={'A'},FieldB={'B'}>} FieldC)

If you have a data set someone can help easily...

1 <<< in Set Analysis would ignore any selections made in filter hence Field A or Field B would be static.

11 Replies
prieper
Honored Contributor II

Re: Set Analysis to show field values based on condition

ONLY then should help....

ONLY({$<FieldA = {"A"}, FieldB = {"B"}>} FieldC)

but then FieldC should be in the dimensions

HTH

Peter

qlikwiz123
Contributor

Re: Set Analysis to show field values based on condition

Hi Peter,

I have tried this before. The issue with Only is, if I select another value in FieldA or Field B other than A and B respectively, the table becomes empty. I need to show the values satisfying ({$<FieldA = {"A"}, FieldB = {"B"}>} FieldC)

irrespective of other values in the given fields. Anyway to achieve it?

prieper
Honored Contributor II

Re: Set Analysis to show field values based on condition

Can you provide an example?

Khan_Mohammed
Honored Contributor II

Re: Set Analysis to show field values based on condition

Try if(getselectedcount(FieldA)>0 your expression?

This would help show values without user selecting any values.

balabhaskarqlik
Honored Contributor

Re: Set Analysis to show field values based on condition

May be this:

If(GetFieldSelections(FieldA)= 'A' and GetFieldSelections(FieldB)='B',FieldC)

qlikwiz123
Contributor

Re: Set Analysis to show field values based on condition

GetSelectedCount(FieldA) requires at least one value to be selected in FieldA. I need to show values of FieldC etc in a table if FieldA and FieldB satisfy the given conditions, irrespective of selections made on FieldA and FieldB; like Set Analysis which shows the data specified in the Set Analysis irrespective of selections made.

Highlighted
qlikwiz123
Contributor

Re: Set Analysis to show field values based on condition

This requires the user to manually select values in FieldA and FieldB, which is similar to what 'if' statement does. Like I stated, my requirement is a bit different.

Khan_Mohammed
Honored Contributor II

Re: Set Analysis to show field values based on condition

Can you please explain with a simple data set?

what do you expect to see if Field A or Field B or Field C is selected or not selected.

Thanks.

qlikwiz123
Contributor

Re: Set Analysis to show field values based on condition

I want to show only those FieldC values in a Straight table that are associated with Value 'A' in FieldA and 'B' in FieldB. This has to be done without the user manually selecting A and B values in FieldA and FieldB respectively. Also, if the user selects any other value except for A and B in FieldA, FieldB, the straight table shouldn't change (The values in the table shouldn't reflect the filters on Field A and FieldB, just like Set Analysis which shows values irrespective of any other selection)