Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
krmvacar
Creator II
Creator II

Networkdays Show Saturday Sunday

Hi All,

I want to show only working weekdays here, but I am getting an error, can you help me?

**

Load editor

SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='#.##0,00 ₺;-#.##0,00 ₺';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD.MM.YYYY';
SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
SET MonthNames='Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara';
SET DayNames='Pzt;Sal;Çar;Per;**bleep**;Cmt;Paz';
SET LongMonthNames='Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık';
SET LongDayNames='Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi;Pazar';
SET FirstWeekDay=0;
SET BrokenWeeks=0;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='tr-TR';

Dimension= 

NetWorkDays(Date#(MonthStart(Tarih),'DD.MM.YYYY'),Date#((Tarih),'DD.MM.YYYY'))

krmvacar_0-1707997886362.png

Best Regards,

Labels (5)
1 Solution

Accepted Solutions
Aditya_Chitale
Specialist
Specialist

If you don't want to show in dimension column itself, then it has nothing to do with the networkdays()  function. You will need to write an if() condition on dimension and remove null values. Something like below:

=if(wildmatch(weekday(Tarih),'Sat','Sun'), null(), Tarih)

Use above expression in 'Tarih' dimension column and untick 'include null values' option.

Hope this helps.

 

Regards,

Aditya

View solution in original post

6 Replies
Aditya_Chitale
Specialist
Specialist

From your screenshot, I don't see anything wrong in calculated net workdays according to the formula. Can you explain where you are getting wrong values ?

For eg. for date 08.01.2023, networkdays showing as 5 as 7th & 8th of Jan 2023 was weekend

Regards,

Aditya

HKN1
Contributor III
Contributor III

Hi,

Can you try this code?

WeekDay(date(Tarih)) as Tarih_week_day

krmvacar
Creator II
Creator II
Author

Hi @Aditya_Chitale 

Thank you for reply.

 

Yes, I don't want it to show the date 08.01.2023 here, I want it to show only the weekday data.

 

how can I do that

Aditya_Chitale
Specialist
Specialist

If you don't want to show in dimension column itself, then it has nothing to do with the networkdays()  function. You will need to write an if() condition on dimension and remove null values. Something like below:

=if(wildmatch(weekday(Tarih),'Sat','Sun'), null(), Tarih)

Use above expression in 'Tarih' dimension column and untick 'include null values' option.

Hope this helps.

 

Regards,

Aditya

theoat
Partner - Creator III
Partner - Creator III

Do you have to use a measure in the table?

I do not recommend the use of calculated dimensions, it is not a good practice. Prioritize restrictions via a set analysis.

King regards,
Théo ATRAGIE.

Aditya_Chitale
Specialist
Specialist

@theoat ,

In that case, you can use same logic in script inside where clause.

load

.....

from xyz.qvd where not wildmatch(weekday(Date),'Sat','Sun');

 

Regards,

Aditya