Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gballester
Creator
Creator

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
swuehl
MVP
MVP

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
Specialist III
Specialist III

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
Creator
Creator
Author

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
Creator
Creator
Author

Thanks Jerry, I tried it but it returns 0.

jwjackso
Specialist III
Specialist III



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

swuehl
MVP
MVP

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?