Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to get a Filter Value in Set Analisys

HY,

let me say that I have a table about regions in my country:

Father , RegionName, Type (R=Region, S = State, C = Country)

Brasil , South , R

Brasil , North , R

South , Rio de Janeiro , S

South , São Paulo , S

North ,  Amazonia , S

North , Acre  , S

Brasil , Rio de Janeiro , C

Brasil , São Paulo , C

Brasil , Amazonia , C

Brasil , Acre , C

So, when i filter by North, I will get Amazonia and Acre.

If I filter using Brasil, I will get all States from Brasil.. and so on..

Now I have some values for each one of these, like

RegionName , Value

Rio de Janeiro , 1

São Paulo , 2

Amazonia , 1

Acre , 3

Now let me say that I have a Filter ( [eIDEBEM]::Region ), with all regions, like:

Brasil

South

North

Rio de Janeiro

São Paulo

Amazonia

Acre

When someone check's Brasil, i Would like to get back all States from Brasil.

I did a Table , with a expression to grab the Type and filter like that

=IF( only({<RegionName=[eIDEBEM]::Region>} Type)='C'

,

only({<Type={'S'}>}Value) //Reference 1

,

IF(

only({<RegionName=[eIDEBEM]::Region>} Type)='R'

,

          only({<Type={'S'},Father=[eIDEBEM]::Region>} Value)

,

only({<Type={'S'},RegionName=[eIDEBEM]::Region>} Value)

)

)

When i choose the Counstry Brasil, and I ask to just print a number instead another set , it filters the Type like a Country (C).

Bu when I use the set, looks like it get's again in this expression and the do not goes to the first condition and then get in the last condition, breaking all the login.

Anybody know What I'm doing wrong?

Dows anyone has another ideias of how solve that?

regards,

Tags (2)
Community Browser