Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
shasha3006
Contributor
Contributor

Set Analysis Less than Date

Hi Good People,

want to ask, 

I want to create a set analysis  for results dated less than 12 months from the current date

this Is my script :

registered_date={"$(=Date(addmonths(MonthStart(Max(MakeDate(Year, Month))),-12),'YYYY-MM-DD'))"}

but, this didn't working.

can anyone help?

thanks 

 

 

Labels (2)
10 Replies
PrashantSangle

can you explain little bit more?? Not working means what?? it is giving incorrect output or not giving any result.

Also, Share the screen shot of out put of what you are trying.

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
vikasmahajan

Hi,

Can you try following set analysis :

SUM({< registered_date = {"<=$(=Date(AddMonths(Max(registered_date ),-12),'MMM YYYY'))"} >}  Your Measure Field)

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
shasha3006
Contributor
Contributor
Author

hi @PrashantSangle , 

i just want to change equal(red remarks)to < (less) than the date

so, I got the result that the data was less than the date  

shasha3006_0-1679898768491.png

 

 

shasha3006
Contributor
Contributor
Author

hi @vikasmahajan ,

 

sorry, but its didn't work

shasha3006_1-1679899122976.png

 

i still get data more than 2022-03-01

vikasmahajan

can you attach sample data ?

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
shasha3006
Contributor
Contributor
Author

dear @vikasmahajan ,

i have data for delivery man, register date and avg spd

i want to the result of is delivery man who is register date less than 9 months (march 2021)  from current date (example , dec 2022) using set analysis

shasha3006_1-1679902111255.png

 

but when I try, I still got data more than march 2021

using this script

drop_salesman_registered_date={"<$(=Date(Addmonths(MonthStart(Max(MakeDate(Year, Month))),-1),'YYYY-MM-DD'))"}

😞

 

vinieme12
Champion III
Champion III

try below

drop_salesman_registered_date={"<$(=Date(MonthStart(MakeDate(Year, Month,1),-8),'YYYY-MM-DD'))"}

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
shasha3006
Contributor
Contributor
Author

hi @vinieme12 , 

 

sorry its didnt work

vinieme12
Champion III
Champion III

can you post a FULL snapshot of your expression editor

 

also " didnt work"  what does this mean? did the expression fail or the results are  not as expected?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.