Hi,
this is the starting situation. This is my full hierarchy, with all level1 and level2 variables.

My goal is to filter the second level with the condition mentioned, but i want to insert into the tree prompt the level1 because i want to see the tree and not a list of elements.
The first level is not filtered, it should show only the elements that respect the criteria, like the example below.

I tried to filter the level2 using that code: "
filter([your set of members], [your measure] > 3)". It works fine for the level2 variables but if i show the first level on tree prompt i see all the variable again.
Thank you------------------------------
valerio pascarella
------------------------------
Original Message:
Sent: Tue November 15, 2022 09:38 AM
From: Mark Fry
Subject: Filter TreePrompt
Hi,
Using detail filters with a dimensional package something I always advise caution over. Detail filters are a relational reporting concept, and can often deliver results that are incorrect when used with a dimensional source.
You mention originally that you are using a tree prompt? Usually you'd feed this with a set of members. It looks like you need the members at level 1 filtered based on a measure value? Do you have the same requirement for members at level 2 also?
For filtering a set of members, rather than using a detail filter, I would suggest you use a dimensional expression for the set, eg
filter([your set of members], [your measure] > 3)
I'm still not clear on how you need your tree prompt to be populated, though. Can you provide more detail?
Cheers!
MF.
------------------------------
Mark Fry
Technical Consultant
Original Message:
Sent: Tue November 15, 2022 02:42 AM
From: valerio pascarella
Subject: Filter TreePrompt
Hi
i'm using a dimensional package. This is the query that i use to filter the level:
Where "Contesto esterno" is the level1 and "Variabili" is the level2.
I use the detail filter to remove the wrong elements.
After that query, i use another simple query linked to the first one to fetch the distinct items.

Let me know if that's clear enough
Thank you,
Valerio
------------------------------
valerio pascarella
Original Message:
Sent: Mon November 14, 2022 01:19 PM
From: Mark Fry
Subject: Filter TreePrompt
Hi,
I'm assuming the report is built over a dimensional package? Can you be a bit more specific about what you are doing? You mention filtering, but is this via a dimensional filter function in an expression, or are you using detail filters? Would the set of members you want to see in Level 2 be static, or would they change over time?
Cheers!
MF.
------------------------------
Mark Fry
Technical Consultant
Original Message:
Sent: Fri November 11, 2022 05:14 AM
From: valerio pascarella
Subject: Filter TreePrompt
Hi,
i have a data structure formed like this:
Hierarchy
-> level1
-> level2
In the report i am using a tree prompt to show level1. I have also created a query which filters out some elements of level2.
When i use the "view tabular data" i see the level1 e level2 filtered with my criteria, but when i put level1 inside the treePrompt i can see only the first level filtred and the second one entirely.
How i can show the correct value for the second level?
Thank you,
Valerio
------------------------------
valerio pascarella
------------------------------
#CognosAnalyticswithWatson