Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
hagay
New Contributor

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));
Tags (1)
1 Solution

Accepted Solutions

Re: where problem

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
3 Replies
khadeer_sparks
Valued Contributor

Re: where problem

(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

Re: where problem

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
New Contributor

Re: where problem

thank you very much,

it's was good idea !

Community Browser