Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
master_student
Contributor II

Error in expression

Hi,

There 's erros in this expression. please help me to find out those errors :

=if(CONGE='Y',HR_CONGE,Hour(Date(if(isnull(PRESENCE),0,PRESENCE/1440),"hh:mm:ss")))&'H:' &Minute(Date(if(isnull(PRESENCE),0,PRESENCE/1440),"hh:mm:ss"))

&'Min'

Thanks

1 Solution

Accepted Solutions

Re: Error in expression

Hi, In that expression you are searching for the value '-', is this value stored in the load of data? Or can be that '-' meant the null values QV draws? If it's a null value maybe with NullCount(MSISDN_APPELANT)

9 Replies

Re: Error in expression

May be this:

=If(CONGE='Y',

HR_CONGE,

Floor(If(IsNull(PRESENCE), 0, PRESENCE/1440)) & 'H:' &

Floor(If(IsNull(PRESENCE), 0, PRESENCE/86400)) & 'Min')

Re: Error in expression

Make sure to use single quotes instead of double quotes around the format string. Actually you can leave out the entire Date() function. It's unnecessary since you use the Hour and Minute functions on the result.

If that doesn't solve the problem then please post a small qlikview document that demonstrates the issue.


talk is cheap, supply exceeds demand
miguelbraga
Valued Contributor III

Re: Error in expression

Hi there,

Try this:

=

if

(

     CONGE='Y',

     HR_CONGE,

     timestamp

     (

          if

          (

               isnull(PRESENCE),

               0,

               PRESENCE/1440

          ),

     "hh"

     )

)

&

'H:'

&

timestamp(if(isnull(PRESENCE),0,PRESENCE/1440),"mm")

&

'Min'

I think this will be without errors

Regards,

MB

miguelbraga
Valued Contributor III

Re: Error in expression

What kind of output does PRESENCE give?

Can you please share with us a QVW or a sample of your data  or even a screenshot of it?

Regards,

MB

master_student
Contributor II

Re: Error in expression

miguelbraga‌ to be honest I don't understand well this expression but the result is duréé 08:00

     see below a part of the concerned table :

LOCATIONTIMECONGEHR_CONGETOT_TIMEPRESENCE
CONGE0Y88h0min480

could you explain it to me

miguelbraga
Valued Contributor III

Re: Error in expression

Your field PRESENCE is the number of seconds of a specific LOCATION.

The TOT_TIME gives you almost the answer you're looking for. Just use this:

=replace(replace(TOT_TIME, 'h', 'H:'), 'min', 'Min')

This will give you the results in your chart

Regards,

MB

master_student
Contributor II

Re: Error in expression

Hi, I need to count the empty cases I did like that and didn't work :

if ([MSISDN_APPELANT] ='-',count(MSISDN_APPELANT))

do you have any idea?

Thanks

Re: Error in expression

Hi, In that expression you are searching for the value '-', is this value stored in the load of data? Or can be that '-' meant the null values QV draws? If it's a null value maybe with NullCount(MSISDN_APPELANT)

master_student
Contributor II

Re: Error in expression

it works with NullCount(MSISDN_APPELANT)

Thanks

Community Browser