Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pashok75
Contributor II
Contributor II

how to use conditional dimension to filter data

Dear all,

I have 4 cities A,B,C,D in the dimension.

 

CITYPRODUCTION
A1000
B2000
C1000
D2000

I need to filter on A,B through calculated dimension. How can use the following functions.

1. =

2. <>

3. Like

4. Not Like

Ashok

12 Replies
Anil_Babu_Samineni

What are you doing with filter CITY?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
pashok75
Contributor II
Contributor II
Author

In the chart i need to show only data for city A, B.  I need to hide C,D

pashok75
Contributor II
Contributor II
Author

Can anyone help me out in this

Or
MVP
MVP

If(City='A' or City='B',City) and Suppress Null is the trivial solution. If you elaborate on what you need, we might be able to suggest a more robust approach.

Anil_Babu_Samineni

Then ,Why can't this?

Sum({<CITY = {'A','B'}>} PRODUCTION)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
stabben23
Partner - Master
Partner - Master

Set analysis as Anil sugest is the best way to filter Dimensions.

Sum({<CITY = {'A','B'}>} PRODUCTION)  gives you A and B

Sum({<CITY -= {'A','B'}>} PRODUCTION) not A and B

Sum({<CITY = {'A*'}>} PRODUCTION) Like, only  A, and wildcard if city like Amsterdam

pashok75
Contributor II
Contributor II
Author

I tried but it is still showing all values.

IF(T_SC_NAME = 'COMP' OR T_SC_NAME = 'TP', T_SC_NAME)

in the above statement T_SC_NAME is my Dimension. I need to show values COMP, TP and eliminate TENANTS, WWP. Check the screenshot for better understanding

SCREENSHOT.png

Or
MVP
MVP

You can't use Conditional Display to filter data. It's as simple as that. You have to filter through a calculated dimension or through the expression (the latter is recommended).

pashok75
Contributor II
Contributor II
Author

Dear Staffan,

The statement is working. But the problem is I am using a variable which has a complex formula to calculate the value and because of that system giving an error allocated memory exceeded. Is there a way to have a condition only based on dimension and inputing the expression in the statement.

For e.g this is my statement in the ENABLE CONTIONAL

SUM({<T_SC_NAME = {'COMP','TP'}>}$(vCountYTD))

Formula in VARIABLE vCountYTD

(Count(DISTINCT{<T_PREM_TYPE={'N','R'}>}if(T_APPR_DT <= AddYears(max(TOTAL T_APPR_DT), T_YEAR - year(max(TOTAL T_APPR_DT))), T_POL_NO))-Count({<T_PREM_TYPE={'C'}>}if(T_APPR_DT <= AddYears(max(TOTAL T_APPR_DT), T_YEAR - year(max(TOTAL T_APPR_DT))), T_POL_NO)))