Matt
Matt

Reputation: 15071

qlikview variable divided by count of a field where monthdatefield is last two months

Ok so i have a variable eIncorrect and two fields Total and CreatedMonthDate

I want to create an expression which is the incorrect amount divided by the count of the total within the last two months.

I have tried this (might as well be pseudo):

=$(eIncorrect)/Count([Total]) where ([CreatedMonthDate] -2)

Which obviously doesn't work.

Upvotes: 0

Views: 1283

Answers (1)

Hal Baggot
Hal Baggot

Reputation: 124

You need to use set analysis. Try something like this:

$(eIncorrect) / count({$<CreatedMonthDate={">=$(=max(CreatedMonthDate)-2)"}>}Total)

Upvotes: 2

Related Questions