Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

It seems that you are ignoring all selection in calendar fields within your dashboard and only looking to see possible Dates with this expression

prees959
Creator II
Creator II
Author

thank you

Anil_Babu_Samineni

It sum the all_values when all possible valuess from Date field and Calendar1 variable. We are not sure, What variable is declare in your environment?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

I think it might be a Concatenated list of fields from the calendar table, but excluding Date field

prees959
Creator II
Creator II
Author

Hi,

Yes, $(vCalendar1) seems to be a concatenated list of fields.  The above expression isn't working correctly. When I place $(vCalendar1) into a textbox there is an Error: Garbage after expression: ","

The variable is set as  [Year],[MonthYear],[Fiscal Month],[Fiscal Yr],[Main Date]

however the expression has a red underline from [Month Year] to [Main Date].

I have checked that all these fields are available in the data model and they are.

Can you help please?

Phil

jonathandienst
Partner - Champion III
Partner - Champion III

>>When I place $(vCalendar1) into a textbox there is an Error: Garbage after expression: ","

That's because $(vCalendar1) is trying to evaluate the list as an expression, which will clearly not work. To see this variable in a text box, just use =vCalendar1 as the expression.

>>however the expression has a red underline from [Month Year] to [Main Date].


For the same reason...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
prees959
Creator II
Creator II
Author

ok,

so should be expression be

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

sunny_talwar

I think for checking its value in text box you need to just use =vCalendar, but within the set analysis, you might still need dollar sign expansion

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

Is this not working?

prees959
Creator II
Creator II
Author

Hi Sunny,

There is a value in the text box - but when the a date value is selected - it doesnt change - whereas a simple sum(all_values) does change when different dates are selected....