Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting back from a selected date

Hello!

I need to create ''count'' the number of dates there since I select date (including this) backwards. I  tried with ''GetTheFieldSelection''  and put it in a script with SET, but I could not.

The program did not recognize it as a function I believe, and I am new in Qlik

Other ways I tried is this, that only works if I'm not selecting anything. When I make a selection, the result always gives the same.


count ({<FechaDeBaja = { "<= $ (max (date (FechaDeBaja)))"}>} FechaBaja)

Thank you very much!

12 Replies
sunny_talwar

May be this:

Count({<FechaDeBaja = {"<=$ (=Date(Max(FechaDeBaja)))"}>} FechaBaja)

sunny_talwar

or this if you date format for FechaDeBaja is not what  have in your environmental variable:

Count({<FechaDeBaja = {"<=$ (=Date(Max(FechaDeBaja), 'DateFieldFormatHere'))"}>} FechaBaja)

Here replace DateFieldFormatHere with your date field format for FechaDeBaja. Also, look here:

Dates in Set Analysis

Not applicable
Author

When I use this function:

Count({<FechaDeBaja = {"<=$ (=Date(Max(FechaDeBaja)))"}>} FechaBaja)


All the results are 0.

sunny_talwar

What format is FechaDeBaja?

Not applicable
Author

Is 28/10/2016

sunny_talwar

Give this a try:

Count({<FechaDeBaja = {"<=$ (=Date(Max(FechaDeBaja), 'DD/MM/YYYY'))"}>} FechaBaja)

Not applicable
Author

No, it doesn't work.

All the results are 0

johnw
Champion III
Champion III

If no dates are skipped and you mean the number of dates in your entire data set backwards.

max(FechaDeBaja) - min({1} FechaDeBaja) + 1

Though I'm unclear if you're trying to use one field or two - FechaDeBaja and FechaBaja. If two, I'm confused. If one, you'd need to fix all suggested expressions to just use the one.

Not applicable
Author

Its just one expression ''FechaBaja''

But this function doesn't work .

I don't know how i can do the Set Analysis or the conditional