Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

kirsten_dc
New Contributor II

Flag for an entire month when a day is already flagged

Dear community,

I have the following problem:

Some days do not have sales. I already flagged these days in my script.

LOAD

if(IsNull(Sales),1,0) as DayFlag,

Date

RESIDENT Temp;

Now, I also need to flag the entire month when there is a day without sales (respectively there is a flagged day in that month).

Are there any suggestions how to solve my problem?

Thanks in advance,

Kirsten

1 Solution

Accepted Solutions
MVP
MVP

Re: Flag for an entire month when a day is already flagged

May be like this:


Table:

LOAD 

if(IsNull(Sales),1,0) as DayFlag, 

Date,

MonthName(Date) as MonthYear 

RESIDENT Temp


Left Join(Table)

LOAD MonthYear,

          If(Sum(DayFlag) = (MonthEnd(Floor(MonthYear)) - MonthStart(Floor(MonthYear))), 1, 0) as MonthFlag

Resident Table

Group By MonthYear;

2 Replies
MVP
MVP

Re: Flag for an entire month when a day is already flagged

May be like this:


Table:

LOAD 

if(IsNull(Sales),1,0) as DayFlag, 

Date,

MonthName(Date) as MonthYear 

RESIDENT Temp


Left Join(Table)

LOAD MonthYear,

          If(Sum(DayFlag) = (MonthEnd(Floor(MonthYear)) - MonthStart(Floor(MonthYear))), 1, 0) as MonthFlag

Resident Table

Group By MonthYear;

kirsten_dc
New Contributor II

Re: Flag for an entire month when a day is already flagged

After some very small adjustments it worked for me.

Great! Thanks!!!

Community Browser