# New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Contributor

## '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

iSam

15 Replies
Not applicable

## 'advanced' expression in a Gauge Chart

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))

Contributor

## 'advanced' expression in a Gauge Chart

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?

iSam

Not applicable

## 'advanced' expression in a Gauge Chart

try this:

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

if that does not work can you post a sample?

Contributor

## Re: 'advanced' expression in a Gauge Chart

Hi,

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

Hope u can help me.

iSam

Contributor

## Re: 'advanced' expression in a Gauge Chart

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!

Valued Contributor III

## 'advanced' expression in a Gauge Chart

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

Contributor

## Re: 'advanced' expression in a Gauge Chart

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

Valued Contributor III

## 'advanced' expression in a Gauge Chart

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

Valued Contributor III

## 'advanced' expression in a Gauge Chart

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

Route:

Route, LimitDays

JFK | AMS, 7

YMQ | AMS, 7

];

to

Route: