Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ZimaBlue
Creator
Creator

Count and formula in the condition

Hello!

I'm trying to do the following:

- I have a pivot table where the column is the months names and the rows are segments.

- as a measure, I need to use the number of users whose last order date was in the date range of each month (for each column).

I'm trying something like this

count({<last_order_date= {">=$(=date(monthstart([date])))<=$(=date(monthend([date])))"}>} distinct user_id)

in different variants (with and without (), with and without = before the formula). The formula window tells me 'OK', but the result is not displayed (displayed as null). 

I cannot use the field with the date of the last order directly in the dimension with the month name, because when i'll manage this, I need to add several more measures to the same pivot table that use other date dimensions.

What am I doing wrong?

unnamed.png

Labels (1)
2 Replies
abhijith28
Creator II
Creator II

You could simply use =count( distinct user_id) right? it returns count for all months

ZimaBlue
Creator
Creator
Author

No, I can't, because I need conditions. last order date is not the same as date, these dimensions have a different data array. in any case, I abandoned these calculations, since I never found a way to implement this in qlik sense. Thnak you anyway