Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
hagay
Contributor II
Contributor II

where problem

hi,

i have a problem with where condition, i want to use WHERE only if some filed =1,

but it's don't work...

here the code:

inner join (CostPrice2)

load "מספר שורת הזמנה",

"מלון שהייה",

"תאריך שהייה לעלות",

Rez_RoomNights,

Index_RoomType_cost,

Index_RoomSet_cost,

CostPrice_ChackIn,

CostPrice_ChackOut,

CostPrice_Cur,

if([תאריך שהייה לעלות]>=CostPrice_ChackIn and [תאריך שהייה לעלות]<CostPrice_ChackOut,1,0)*CostPrice_cost as CostPrice_cost,

CostPrice_IfRoom,

CostPrice_ifPeople

resident CostPrice2

where ([תאריך שהייה לעלות]>=CostPrice_ChackIn and [תאריך שהייה לעלות]<CostPrice_ChackOut) and

(if(CostPrice_IfRoom=1,Index_RoomType_cost2=Index_RoomType_cost));
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this:

where ([תאריך שהייה לעלות]>=CostPrice_ChackIn and [תאריך שהייה לעלות]<CostPrice_ChackOut) and
((CostPrice_IfRoom=1 and Index_RoomType_cost2=Index_RoomType_cost) or (CostPrice_IfRoom<>1));


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
khadeer_sparks
Specialist
Specialist

(if(CostPrice_IfRoom=1,Index_RoomType_cost2=Index_RoomType_cost));

pls check this if condition.

if(condition, true value, false value)

but u have writter two conditions. then u have to write multiple if

Gysbert_Wassenaar

Try this:

where ([תאריך שהייה לעלות]>=CostPrice_ChackIn and [תאריך שהייה לעלות]<CostPrice_ChackOut) and
((CostPrice_IfRoom=1 and Index_RoomType_cost2=Index_RoomType_cost) or (CostPrice_IfRoom<>1));


talk is cheap, supply exceeds demand

View solution in original post

hagay
Contributor II
Contributor II
Author

thank you very much,

it's was good idea !