Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
gballester
Contributor

set analysis and alternate state

Good evening,


I am using QlikView Alternate State functionality for the first time.


It is an excellent and very powerful functionality, but I have a problem.

In a pivot table I have to perform a set analysis that considers QlikView's default filters, but for a field that you select using the defined alternate state (ELE_CREC01), you should ignore the default selection for that field.

If the field is fixed with any of these two syntax, everything works ok.


SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},DESC_RAIZ= P({ELE_CREC01} DESC_RAIZ) >} CANTIDAD)

SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},DESC_RAIZ= ELE_CREC01::DESC_RAIZ >} CANTIDAD)


The problem is that the field is dynamic and I do not know how to put together the set analysis indicating that it takes the selected value in the listbox defined with the alternate state.


The expression I tried to use without success is:


SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},DESC_RAIZ= ELE_CREC01::=$(=CAMPO_DIMENSION_ELE_CRECIMIENTO) >} CANTIDAD)


where CAMPO_DIMENSION_ELE_CRECIMIENTO is the field that was selected to filter in the alternate state ELE_CREC01.


Would someone be so kind as to tell me what is wrong with the analysis set and what is the correct way to do it?


Thank you very much!!!


Guillermo

6 Replies
MVP
MVP

Re: set analysis and alternate state

Wouldn't you need to change the field left of the equal sign also?

And have you double checked that your dollar sign expansion correctly inputs the field name into the set expression?

jwjackso
Valued Contributor

Re: set analysis and alternate state

Try using the P() function


SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},DESC_RAIZ=P([ELE_CREC01]::CAMPO_DIMENSION_ELE_CRECIMIENTO) >} CANTIDAD)

gballester
Contributor

Re: set analysis and alternate state

You are right, I did so many tests that I copied an expression where I have hard-coded the field. The formula I want to use is:


SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},$(=CAMPO_DIMENSION_ELE_CRECIMIENTO) = ELE_CREC01::$(=CAMPO_DIMENSION_ELE_CRECIMIENTO) >} CANTIDAD)

but it does not work for me, I can not get the election done in the alternate state.


gballester
Contributor

Re: set analysis and alternate state

Thanks Jerry, I tried it but it returns 0.

jwjackso
Valued Contributor

Re: set analysis and alternate state



SUM({<PERIOD_ID ={">=1<=12"},PERIOD_TYPE_ID={21},DESC_RAIZ=P([ELE_CREC01]::CAMPO_DIMENSION_ELE_CRECIMIENTO) *P({1} DESC_RAIZ)>} CANTIDAD)

MVP
MVP

Re: set analysis and alternate state

What exactly is CAMPO_DIMENSION_ELE_CRECIMIENTO ?


I assume it's a variable? But how have you defined this variable and how have you verified its correct expansion?