Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
capriconuser
Creator
Creator

where condition in dimension

I have a script but i dont want to write where condition in this script  

i have dimensions like these

ID

Name 

Type

there is 3 types of people now i want only 3 type in table but i dont want to put where condition in script because this table is associated with other tables so i am trying to filter it out on TYPE dimension how i done this 

any help ?

??

9 Replies
pradosh_thakur
Master II
Master II

Assuming you want a,b,c you can do the following.

inner join (Your_source_table)

load * inline [

Type

a

b

c

];

 

Learning never stops.
capriconuser
Creator
Creator
Author

no i dont want like that i want to filter it our on dimension not on script .. 

 

i have data like this 

type 

1

2

3

 

 i add dimension TYPE then from that i only want 3 

i dont want to where condition in script 

pradosh_thakur
Master II
Master II

try this in filter

if(type=3,type,null()) 

Learning never stops.
jyotiwagde
Partner - Contributor
Partner - Contributor

if(type=1 or type=2 or type= 3 ,type) 

capriconuser
Creator
Creator
Author

this is not working

jyotiwagde
Partner - Contributor
Partner - Contributor

if type field is in Text format put it in ' '(Single quote) 

capriconuser
Creator
Creator
Author

i did that but not working 

if(type='3',type)

pradosh_thakur
Master II
Master II

What exactly is the requirement? you are writing two fields type and TYPE. which is confusing . PLease state your requirement clearly to help you better. the above solution should have worked.
Learning never stops.
capriconuser
Creator
Creator
Author

type is TYPE is same .. 

look there is the data in TYPE column I.E. 1,2,3 now i want 3 type in my data like with this i have a separate columns from different tables 

i,e, 

name     country      address               type 

abc           US           none                      1

xyz           UAE         abc_address     3

def          MAL       gh_Address         2

and so on data 

 

type typename

1          low

2          high

3         medium 

 

 

now i add script like this 

 

load name , country , address type from abc_file 

and on the other tab 

load type,typename from type_file 

 

 

now if i only want data type 3 is supposed to write script like this 

load name , country , address type from abc_file   where type=3

but i dont want like this 

 

i add table then i add dimensions i.e. name and type so now on that type dimension how i add where condition  ?