Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
micheledenardi
Specialist II
Specialist II

Count Number of working days till fact date

Dear all,

i've a calendar composed as by "Posting Date" and a flag which define if "posting date" is a working day or not based on internal production schedule.

micheledenardi_1-1624002013781.png

i would like to write an expression, using set analysis, to summarize [Flag Posting Is Working Day] till the posting date, in order to obtain the column in yellow which contains the number of working days till month start.

Can someone help me on this?

i attach some example data.

Thanks

 

 

4 Replies
Taoufiq_Zarra
Master II
Master II

@micheledenardi 

dont need a set analaysis you can use :

rangesum(above(total sum([Flag Posting Is Working Day]), 0, rowno(Total)))

output:

Taoufiq_Zarra_0-1624006507005.png

 

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
micheledenardi
Specialist II
Specialist II
Author

Thanks  @Taoufiq_Zarra, for your approach.

Your solution works only if we keep all dates in the table. If we filter one date or if we want to use your solution in a chart, it wont works.

 

I'm looking for something like:

Sum({<[Posting Date]={"<=$(=date([Posting Date]))"}>}[Flag Posting Is Working Day])

But obviously this don't work...

Taoufiq_Zarra
Master II
Master II

@micheledenardi  and if we propose something in load script ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
micheledenardi
Specialist II
Specialist II
Author

Yes, in this case I already created one new field in load script with the cumulative working days per month but i would like to find a solution also via set analysis, it could be helpful in some future projects 😁