Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problems with Gauge Chart, Set Analysis and Networkdays

Hi Guys,

I'm problem with a formula into a gauge chart, here is:

=avg ( {$< EstadoReport = {"Em Curso","Em Contacto","Fecho Sucesso","Fecho Insucesso"},
Opty_Creat_Dt = {">=$(#=vInicio)<=$(#=vFim)"} > } (networkdays(date(Opty_Creat_Dt),date(Tlcl_Answer_Dt),$(allholidays))) )

I want to know the average in the last 90 days but using the networkdays.

"allholidays" is a variable with all holidays in my country.

This formula give "no data value" but I don't know why.

If I use:

=avg ( {$< EstadoReport = {"Em Curso","Em Contacto","Fecho Sucesso","Fecho Insucesso"},
Opty_Creat_Dt = {">=$(#=vInicio)<=$(#=vFim)"} > } ALL (networkdays(date(Opty_Creat_Dt),date(Tlcl_Answer_Dt),$(allholidays))) )

...works fine.

But I cannot use ALL.......

What I can to do?

Anybody can help me, please?

Thanks,

Rodrigo.

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

   If you want to do same thing as you said then, you can calculate the day difference in load time only like this,

   Load

       ID,

        Creation_Date,

        Update_Date,

        Update_Date - Creation_Date as Day_Difference

    From

        Xyz.

    Then  use the field Day_Difference to calculate the Average.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

15 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   There is one mistake i found in this expression. i.e the use of variable.

   Try this expression - not sure that this will give you desired output, but variable's should be used like this.

    =avg ( {$< EstadoReport = {"Em Curso","Em Contacto","Fecho Sucesso","Fecho Insucesso"},
Opty_Creat_Dt = {">=$(#vInicio)<=$(#vFim)"} > } (networkdays(date(Opty_Creat_Dt),date(Tlcl_Answer_Dt),$(allholidays))) )

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Kaushik,

I'm sorry... but it occours the same.

It's no value data with both formulas.

Thanks,

Rodrigo.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

 

    Can you tell me what actually you want to do and for what purpose.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

I want to know the average number of days (working days) that enlapses between the dates (updated date and creation date).

Thanks,

Rodrigo.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   How can it be the average, it should be the count of the days right...?

   If not can you explain with an example.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

I want to know the average... it is not a count.

Exemple:

Id          Creation Date       Update Date       *Diff (upd date - creat date)

aaa       2010-12-22           2010-12-24          2

bbb       2010-12-21           2010-12-26          5

ccc       2010-12-23           2010-12-26          2  (christmas holiday)

ddd       2010-12-21           2010-12-22          1

Total count of the days: 10

Average: 2,5 days

In the other words, the date is closed on average 2 and a half days.

Thanks,

Rodrigo.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

   If you want to do same thing as you said then, you can calculate the day difference in load time only like this,

   Load

       ID,

        Creation_Date,

        Update_Date,

        Update_Date - Creation_Date as Day_Difference

    From

        Xyz.

    Then  use the field Day_Difference to calculate the Average.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

Ok.

Can I use in the load script the variable $holidays??

Thanks,

Rodrigo.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Yes you can use the variable in load statement.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!