Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

last day - with any selection

Hi all,

I have the following formula in textfield that should give the number of DimensionToCount on the day that is before the selected day (or month):

count(if (InDay (Date, vDateToAnalyse, -1), DimensionToCount))

vDateToAnalyse:  DayName (max(Date), 0)

That returns the correct number if I have no selection. But if I choose another day and want to see the Value of the day before, I get "0" because of the selection. 

I thought something like that could be the solution: count({1}if (InDay (Date, vDateToAnalyse, -1), DimensionToCount))

But that Returns the wrong value. Does anyone have an idea how to solve this problem?

Many thanks in advance

Agathe

6 Replies
pokassov
Specialist
Specialist

Hello!

Add

vDateToAnalyse:  DayName (max({1}Date), 0)

Not applicable
Author

Thanks a lot for your reply.

I tried your suggestion, but that leads to the Problem, that the date is fix to the max date. But in the formula I want to have a variable date in relation to the selection.

Best regards

Agathe

tresesco
MVP
MVP

Try like:

count({<Date={'$(=Date(Max(Date)-1))'}>} DimensionToCount)

If this doesn't work, try to share a samplw qvw.

Not applicable
Author

Hi,

sorry for waiting so long, but many thanks to you for your answer.

Unfortunately your Suggestion didn´t work. :-(.

I created an example:

tresesco
MVP
MVP

For last month try:

=count({<Month={'$(=Month(AddMonths(Max(Date),-1)))'}>} Employee)

Not applicable
Author

That showed a number in the demo but unfortunately not in my master file. I will try it otherwise but many thanks for your help.