Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

'advanced' expression in a Gauge Chart

Hi Guys,

I'm still a newbie so forgive me for my ignorance.

I used to have a expression for my gauge chart that would calculate the performance of shipments ontime:

gauge expression:

Count({<Status={OnTime}>} Destination) / Count ( {<Status= >} Destination)

Since my data got a bit complex I had to remove the field "Status". Instead I would use an calculated dimension to see how many shipments are ontime or late.

This would be my chart expression.

=if(NetWorkDays(DEP,POD)<='LimitDays', 'OnTime', 'Late')

This works fine on a bar chart as it shows me ontime and late shipments.

I now want to messure the preformance, so I was wondering how can I translate the above gauge expression, without having a the status field?

The expression should be something like this

Count(Distinct Shipmentnumber that are ontime and divide them by all the shipments (ontime and late)

Dont know how to translate that to qlikview language :S

Thanks in advance

iSam

15 Replies
Not applicable
Author

This should work:

This will give you on time

sum(if(NetWorkDays(DEP,POD)<='LimitDays', 1, 0))

This will give you Late

sum(if(NetWorkDays(DEP,POD)<='LimitDays', 0, 1))

I think this would work for the percent:

sum(if(NetWorkDays(DEP,POD)<='LimitDays', 1, 0)) / sum(if(NetWorkDays(DEP,POD)<='LimitDays', 1, 1))

Anonymous
Not applicable
Author

Hi,

Thanks for your help! the expression you made, gives me a constant result of 100%. I've copied the expression to a bar chart, unfortunatelly it gives me the same results.

Do you have any other ideas?

Thanks in advance!

iSam

Not applicable
Author

try this:

sum(if(NetWorkDays(DEP,POD)<='LimitDays', 1, 0)) /Count (Destination)

if that does not work can you post a sample?

Anonymous
Not applicable
Author

Hi,

Unfortunately that didn’t work. Attached is a sample.

Hope u can help me.

Thanks in advance!

iSam

Anonymous
Not applicable
Author

Ps: Basically I want qlikview to count (distinct) the STT unique shipping number that are ontime and divide them by all the shipments that are late and ontime. I just don't know how.

Cheers!

Anonymous
Not applicable
Author

How do you determen if the shipment is on time? Which fields must I use for that?

Anonymous
Not applicable
Author

Hi Dennis,

You can use the field LimitDays. E.g. I created a bar chart with 2 dimension: month and a calculated dimension ‘ if(networkdays(DEP,POD)<=’LimitDays’, ‘OnTime’, ‘Late’) ‘ then I created the expression count (Distinct STT). Based on that I get the all the shipments that are ontime and late.

I just don’t know how to translate it to a gauge chart since I’m not allowed to add dimesion in a gauge chart.

Does this info help?

Regards,

iSam

Anonymous
Not applicable
Author

The field LimitDays is empty in (almost) all rows, in the QV-file you uploaded ...

Anonymous
Not applicable
Author

I see. I think you have to change this in your load script:

Route:

LOAD * INLINE [

Route, LimitDays

    JFK | AMS, 7

    YMQ | AMS, 7

];

to

Route:

LOAD * INLINE [

Route, LimitDays

    JFK|AMS, 7

    YMQ|AMS, 7

];

And share it again please.