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: 
alec1982
Specialist II
Specialist II

Issue with Where in the script

Hi Guys,

I am having issue with using where in the script. If I comment the Where statement I get data and if I add it no data will show on the table.

I noticed that the issue is in the and in the where statement..but not sure how to fix

ActualYTDBalance:

Load

Year,

Period,

Name,

Sum(AmountYTD) as  Amount

Resident AA2

where Name='1100' and Name='1105'

Group by Year,Period,Name;

Let me know if you can help!

Best,

Badr

Labels (1)
1 Solution

Accepted Solutions
rbecher
Partner - Master III
Partner - Master III

Hi Badr,

it's an OR, the field can have only one value per record:

where (Name='1100' or Name='1105')

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine

View solution in original post

5 Replies
rbecher
Partner - Master III
Partner - Master III

Hi Badr,

it's an OR, the field can have only one value per record:

where (Name='1100' or Name='1105')

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
MayilVahanan
MVP
MVP

Hi

Edit:

ActualYTDBalance:

Load

Year,

Period,

Name,

Sum(AmountYTD) as  Amount

Resident AA2

where Match(Name,'1100','1105')

Group by Year,Period,Name;

If you use AND function, it does not display any value because, a single row contain single name

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
jagan
Partner - Champion III
Partner - Champion III

Hi,

Instead of OR you are using AND condition, because a Name field cannot have two values at a time.

ActualYTDBalance:

Load

Year,

Period,

Name,

Sum(AmountYTD) as  Amount

Resident AA2

where (Name='1100' OR Name='1105')

Group by Year,Period,Name;

Hope this helps you.

Regards,

Jagan.

VishalWaghole
Specialist II
Specialist II

Try this One, May this will help you


ActualYTDBalance:

Load

Year,

Period,

Name,

Sum(AmountYTD) as  Amount

Resident AA2

where Match(Name,'1100','1105')

Group by Year,Period,Name;

alec1982
Specialist II
Specialist II
Author

Thank you guys! I totally missed the and , or differences