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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
MK25
Contributor
Contributor

Set Analysis

Hi,

I have problem with set analysis. I would like to write expression which would sum sales only for last day and would do new result when I select other selection except when I select year, month year or Date in that case shouldn’t show new result.

____

Let vDate = '=Max(Date)';

____

Sum({<Date={"$(vDate)"},[month year],year, Date>}PV)

 

Any help woud be very appreciated.

 

Labels (2)
8 Replies
Or
MVP
MVP

The second Date in the set analysis needs to be removed - you can't apply two selections to the same field in the same set.

vikasmahajan

Hi ,

Have you try following

Sum({$ <Date= { "$( =$(vDate) )" }>}  PV)

thanks

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.
MK25
Contributor
Contributor
Author

If I try Sum({$ <Date= { "$( =$(vDate) )" }>}  PV) I get 0 as a result.

anat
Master
Master

Sum({<Date= {"$(=Max(Date))"},[month year]=,year=, Date=>}PV)

MK25
Contributor
Contributor
Author

 

If I try this: Sum({<Date={"$(vDate)"},[month year],year >}PV) and select diferent month year or year I get new resoult and that is not OK.

The fields month year and year I get from fild Date:

Date(Monthstart([Date]),'MM-YYYY') as [month year],

 

MK25
Contributor
Contributor
Author

Sum({<Date= {"$(=Max(Date))"},[month year]=,year=, Date=>}PV)

Still the same problem, if I select diferent month year or year I get new resoult and that is not OK.

 

 

anat
Master
Master

Sum({1<Date= {"$(=Max(Date))"},[month year]=,year=, Date=>}PV)

or

Sum({<Date= {"$(=Max({1}Date))"},[month year]=,year=, Date=>}PV)

MK25
Contributor
Contributor
Author

If I try this: Sum({1<Date= {"$(=Max(Date))"},[month year]=,year=, Date=>}PV) I get always the same result no matter what I select and as result I get sum of all date not just last date.

 

If I try this: Sum({<Date= {"$(=Max({1}Date))"},[month year]=,year=, Date=>}PV) selection work perfect but again always sum for all date not just last date.