Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
shakeeb_mohammed
Contributor III
Contributor III

Expressions

Hi,

can someone assist me with the below please?

I have 3 fields in my app - One is called 'DepartureStatus'  the other one is called 'Trip' and the last one is called 'Location'

DepartureStatus field contains - OnTime,Late and Early and the Trip field contains Trip numbers and location has site departments.

What i want is show how many trips where on Time, early or late by location in a bar chart.

I'm having problems writing this expression - When I use sum(DepartureStatus) and use Location as Dimension i don't get a result  but i do when i use Count - but the figure is incorrect.

Can someone shed some light on this please?

11 Replies
shakeeb_mohammed
Contributor III
Contributor III
Author

In my data source i have an extra field which is  ItemCode which will always be unique - so for 1 trip i could have 5 items so that trip number will be listed down 5 times in my data file.

timpoismans
Specialist
Specialist

But if that trip number is listed 5 times, the DepartureStatus is the same 5 times as well?

Then use Count(distinct Trip) as Omar suggested.