Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulsingh12
Contributor III
Contributor III

Set Analysis

Hi,

How Should I write my expression if i want the last 6 months data to be selected from the current selected month?

Regards,

12 Replies
sunny_talwar

May be this

{<Date = {"$(='>=' & Date(MonthStart(Max(Date), -6), 'DateFieldFormatHere') & '<=' & Date(Max(Date), 'DateFieldFormatHere'))"}, Month>}

rahulsingh12
Contributor III
Contributor III
Author

It is showing error in expression

sunny_talwar

No idea what you used, I just showed you how the basic syntax looks like...

rahulsingh12
Contributor III
Contributor III
Author

{<Date = {"$(='>=' & Date(MonthStart(Max(Commondate), -6), ''mm/dd/yyyy'') & '<=' & Date(Max(commondate), 'mm/dd/yyyy'))"}, commonmonth>}

I have replaced it with the fields I have


Regards,

sunny_talwar

What is the expression you used my friend?

rahulsingh12
Contributor III
Contributor III
Author

I am new to set so maybe not using the expression properly.

I have two fields Common month and Common year in the selection.

where should I fit it in the expression/

sunny_talwar

What was your expression where you were trying to implement this?

rahulsingh12
Contributor III
Contributor III
Author

It was just count(A) that's it.

Regards,

vishsaggi
Champion III
Champion III

Based on your expr is this what you were trying?

= Count({<Date = {"$(='>=' & Date(MonthStart(Max(Commondate), -6), 'mm/dd/yyyy') & '<=' & Date(Max(commondate), 'mm/dd/yyyy')) }, commonmonth >} YourActualField)