Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

One Filter for Two Alternate States

Hi Community,

I have two compare two scenarios and for that I have two alternate state (as1,as2).

For this I have 5 (5X2) different filters, out of that three filter should be same for both states.

So is there any way I can use one filter for two alternate states.

Thanks in Advance

Prakash

1 Solution

Accepted Solutions

Re: One Filter for Two Alternate States

Yeah, you can do that. but it will something different

Keep those three filter in default state and in expression use something like this

Sum({$*[Alternate State1]} Sales)//$ represents default state

10 Replies
vardhancse
Valued Contributor III

Re: One Filter for Two Alternate States

Alternate state is only for comparative analysis.

Like base don the alternate state, the selections will pass.

Even though common filters, based on the alternate state the selections will pass.

sushil353
Honored Contributor II

Re: One Filter for Two Alternate States

Hi,

See if this can help you: Alternate States issue using same variable

HTH

Sushil

Re: One Filter for Two Alternate States

Yeah, you can do that. but it will something different

Keep those three filter in default state and in expression use something like this

Sum({$*[Alternate State1]} Sales)//$ represents default state

vardhancse
Valued Contributor III

Re: One Filter for Two Alternate States

Hi,

If the objects have different alternate states.

How can the selections will pass.

CAn we pas variables directly.?

Re: One Filter for Two Alternate States

By using set analysis we can choose the state that needs to apply, regardless objects state.

Not applicable

Re: One Filter for Two Alternate States

Thanks all for your time any answers, I really appreciate your help a lot. 🙂

Not applicable

Re: One Filter for Two Alternate States

Hi celambarsan,

Thanks for your wonderful help.


The above expression is working fine for me also in my one case.But in anther case of second expression not able to implement please help me out.

Variables written in the script:

set vAffinity1 =sum({<affinity_id={1}>} affinity_param_count) / sum({<affinity_id={1}>}total_population_affinity);

set vAffinity2 =sum({<affinity_id={2}>} affinity_param_count) / sum({<affinity_id={2}>}total_population_affinity);

set vAffinity3 =sum({<affinity_id={3}>} affinity_param_count) / sum({<affinity_id={3}>}total_population_affinity);

set vAffinity4 =sum({<affinity_id={4}>} affinity_param_count) / sum({<affinity_id={4}>}total_population_affinity);

set vAffinity5 =sum({<affinity_id={5}>} affinity_param_count) / sum({<affinity_id={5}>}total_population_affinity);

Expression used in the text object.

X=Num((0.16 * $(vAffinity1)) + (0.27 * $(vAffinity2)) + (3.2 * $(vAffinity3)) + (4.65 * $(vAffinity4)) + (2.32 * $(vAffinity5)),'###.00')

We want to calculate the value of X based on the selection alternate state filters.

Please help me ASAP

Regards,

Venugopal G

Not applicable

Re: One Filter for Two Alternate States

Hi Celembarsan,

Above Expression is working for me..Thanks for your reply.

I Need one more help, One specific filter should not apply to chart even after making the selections in the filter.

Sum( {$*[StateA]}  dollar_value_sold)

Please help me as soon as Possible.

Regards,

Venugopal G

Re: One Filter for Two Alternate States

if you want to ignore one specific filter

then you can use

Sum( {$*[StateA]<FieldNAme=>}  dollar_value_sold)