Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

aboumejjane
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 Smiley Frustrated

Thanks in advance

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

aboumejjane
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?

Thanks in advance!

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?

aboumejjane
Contributor

Re: 'advanced' expression in a Gauge Chart

Hi,

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

Hope u can help me.

Thanks in advance!

iSam

aboumejjane
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!

dennisnet
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?

aboumejjane
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

dennisnet
Valued Contributor III

'advanced' expression in a Gauge Chart

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

dennisnet
Valued Contributor III

'advanced' expression in a Gauge Chart

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.