Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
New Contributor II

Count Days

Hi Team,

I have 2 Measures,

1. Sum(Actual)

2. Sum(Plan)

I have the records from 1st Jan 2018 till Date

The requirement is , i have to count the no of distinct days where my  sum(Actual) < sum(Plan).

Can anyone help me on this

Tags (1)
2 Replies
Valued Contributor

Re: Count Days

Hi, If there is a date field in the model try this

Sum(if(Aggr(sum(Actual) - sum(Plan), DateField) < 0, 1, 0))

New Contributor

Re: Count Days

Hi Senthil,

If you want to calculate for all days , then you can use =Date2-Date1

And if you want to calculate working day, then use =Networkdays (StartDate, EndDate {, Holiday})

You can write the expression as ,

if (sum(Actual) < sum(Plan),Networkdays (StartDate, EndDate {, Holiday}))


if (sum(Actual) < sum(Plan),Date2-Date1)

The Networkdays () returns the number of working days (Monday-Friday) between and including StartDate and EndDate taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.