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: 
master_student
Creator III
Creator III

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
rubenmarin

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)

View solution in original post

9 Replies
sunny_talwar

May be this:

=If(CONGE='Y',

HR_CONGE,

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

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

Gysbert_Wassenaar

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
Partner - Specialist III
Partner - Specialist III

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
Partner - Specialist III
Partner - Specialist III

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
Creator III
Creator III
Author

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
Partner - Specialist III
Partner - Specialist III

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
Creator III
Creator III
Author

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

rubenmarin

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
Creator III
Creator III
Author

it works with NullCount(MSISDN_APPELANT)

Thanks