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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is wrong with my date set expression

Hi guys,

I can't get set expressions working with dates. e.g. Show me only row counts for first day of last month.

Capture.PNG

The column is calculated as:

Count({<Date={"$(=date(MonthStart(today(),-1)),'DD/MM/YYYY')"}>}ID)

I would expect to see values in the 2nd and 4th row, but instead I see 0 for every row. The date format seems to match (as you can see in KPI indicator). The data model is super simple:

Load

ID,

date(date#(date, 'YYYY-MM-DD'), 'DD/MM/YYYY') as [Date],

date(date#(activation_date, 'YYYY-MM-DD'), 'DD/MM/YYYY') as [Activation Date];

Select

ID,

cast(created as date) as date,

cast(activation_date as date) as activation_date

from table;

What am I doing wrong?

7 Replies
rittermd
Master
Master

I would try displaying the entire expression to get the first day of the month just to confirm that you are still getting what you expect.

date(MonthStart(today(),-1)),'DD/MM/YYYY')

sunny_talwar
MVP
MVP

May be try this

Count({<Date={"$(=Date(MonthStart(Today(), -1), 'DD/MM/YYYY'))"}>} ID)

Anonymous
Not applicable
Author

Hi,

better create a variable for that and use it in the expression.

Regards,

Sadasiva

Kushal_Chawda
MVP
MVP

Error in your expression, ')' is missing for $()

Count({<Date={"$(=date(MonthStart(today(),-1)),'DD/MM/YYYY')"}>}ID)


Change it to below


Count({<Date={"$(=date(MonthStart(today(),-1),'DD/MM/YYYY'))"}>}ID)

sunny_talwar
MVP
MVP

Cheating karta hai meri

Kushal_Chawda
MVP
MVP

samjana chahiye na bhai

sunny_talwar
MVP
MVP

Hahahaha

Sahi bolta hai tu