Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Month End Function

Hi All,

I'm having a problem with the very simple code below?

if ( MonthEnd(dt_ag_closed,0 ) = monthend (dt_processed,0) , 1,0)

All values are being returned as 0 whereas I know there are some 1's where the if statement is true.

Any ideas?

Thanks,

Joseph.

7 Replies
swuehl
MVP
MVP

How do you know that the if() statement is true for these cases?

What's the format of both fields?

Are both showing a numeric representation?

Do both fields show a unambiguous value within the scope of the if() statement?

Not applicable
Author

I see no problem in your code. Maybe the problem is the format of your fields?

Can you add a sample of data?

sunny_talwar

Can you may be check this:

If(Floor(MonthEnd(dt_ag_closed)) = Floor(MonthEnd(dt_processed)), 1, 0) as Flag

Not applicable
Author

Didn't work

Not applicable
Author

I have a view of the input data and have physically checked.

Both fields are of the format ddmmyyyy8.

Both are numeric.

Not sure what you mean on the last q?

sunny_talwar

Do you have a sample you can share?

swuehl
MVP
MVP

With the last question I wanted to ask:

In which context (AKA where? a chart? script? text box? Using dimensions? How are fields related?) are you using that expression.

For an expression, you need to use aggregation functions:

Use Aggregation Functions!