Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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));
Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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
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
Partner - Champion III
Partner - Champion III

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
hagay
Contributor II
Contributor II
Author

thank you very much,

it's was good idea !