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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
prees959
Creator II
Creator II

Set Analysis Explanation

Hi.

Can someone explain what is happening in this expression please:

=sum({<$(vCalendar1),Date=P(Date)>}[all_values])

Many Thanks,

Phil

12 Replies
sunny_talwar

What is difference between Date and Main Date? I see your variable uses Main Date within vCalendar? Do you make selection in Main Date or Date?

prees959
Creator II
Creator II
Author

sorry,  the expression should read :

=sum({<$(vCalendar1),[Main Date]=P(Date)>}[all_values])


vCalendar1 is set to [Year],[MonthYear],[Fiscal Month],[Fiscal Yr],[Main Date]


Date selections are made using the fields used in the variable above.    One thing I can see is that Date is in a calendar which isn't joined in my data model....    [Year],[MonthYear],[Fiscal Month],[Fiscal Yr],[Main Date] are all part of a SalesCalendar  which is connected in the data model....

Phil



sunny_talwar

Make sure that vCalendar1 is without Main Date because you cannot have 2 set analysis on the same field.... If you go have that only the first one is honored... so in your case because [Main Date] comes before [Main Date] = p(Date), the first one work, second one doesn't. A work around would be to use this

=Sum({<[Main Date]=P(Date), $(vCalendar1)>}[all_values])