MicroStrategy Forum

The Best MicroStrategy Forum
It is currently Thu Sep 09, 2010 11:16 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Where Clause in Attribute
New postPosted: Tue Mar 09, 2010 2:13 pm 
Offline

Joined: Tue Mar 09, 2010 2:09 pm
Posts: 1
Hi All,


I want to put a Where Clause in Attribute..I used ApplySimple with CASE and DECODE Satement, but Im getting a null for other values.

Ie

my table structure is
Emp Dept
101 10
102 10
103 10
104 20
105 20

I need a attrbute which can show up only the Employee no's which belongs to DEPT.

When I used the folloiwng applysimple im getting one NULL ROW for other records.
ApplySimple("decode(#0, 10,#1)", [DEPT], [EMP])

MSTR SQL : select distinct decode(a11.DEPT, 10,a11.EMP) EMP
from SC.EMPLOYEE a11

Output :
Emp
NULL
NULL

101
102
103

Note :Since I want to use it inside Object Prompt i cannot create filter outside.I have filter inside attrbute itself.

Please help me to solve the above issue...thank you in advance.

Regads
Abin


Top
 Profile E-mail  
 
 Post subject: Re: Where Clause in Attribute
New postPosted: Fri Mar 19, 2010 11:50 am 
Offline

Joined: Fri Mar 19, 2010 10:14 am
Posts: 2
Hi


Last edited by natarajanK on Wed Mar 24, 2010 4:30 am, edited 1 time in total.

Top
 Profile E-mail  
 
 Post subject: Re: Where Clause in Attribute
New postPosted: Tue Mar 23, 2010 12:51 pm 
Offline

Joined: Fri Mar 19, 2010 10:14 am
Posts: 2
:idea:
Create a logical table with the columns you need for that attribute with your filter condition. For E.g : Requirement : Country Attribute should have elements where country_id in 1,2,3.

I created a logical table with query 'select COUNTRY_ID,COUNTRY_NAME from LU_COUNTRY where country_id in (1,2,3)'.

Created an attribute based on that table with country_id as its ID, country_name as its description.

Now the attribute is a filtered attribute. If it is put in a report it displays country names where country_id in (1,2,3) . Element prompt shows only those values.

If anybody have any simple solution than dis. Plz share.. :ugeek:

You may get datatype conflict in MSTR 9 when mapping the country ID with other tables. :twisted:


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group