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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mavericklee
Partner - Contributor
Partner - Contributor

Variable with parameter in Set Analysis

Hi Gurus,

I am now writing a variable as the expression for the dashborard that containg parameter as the set analysis modifier.:

sum({<CalendarDate={">=$(vCurrentMinDate) <=$(vCurrentMaxDate)"},CalendarWeekDay={Fri},$1>}Amount)


while the $1 is another variable "vFirstPeriod" equal to this:


=if(vType=2,

'MonthYear={"$(=$(vCurrentFirstMonth))"}'

,'CalendarWeek={"$(=$(vPeriodWeek($(vCurrentMinDate), $(vCurrentMinDateFirstWeekEnd))))"}'

)


So the final expression appears in the table is like this:


=$(vtest1($(vFirstPeriod)))


The result is that the expression can be evaluated but coming with a wrong result.


The reason is the first parameter cannot be evaluated.


Would anyone suggest the correct syntax for that?


Thanks.

1 Solution

Accepted Solutions
marcus_sommer

I don't want to say that's not possible to get such a construct to work but I think that your nesting of variables which also contain nested variables is an overuse of variables respectively the idea behind them - which is mainly to simplify things.

In my opinion are the efforts to develop and maintain here a stable solution much higher as the benefit (and there is always a risk that you couldn't include all needed functionalities or parameters).

Therefore I suggest to rethink your whole approach. Nevertheless if you want to continue with your approach you will find here multiple postings to this topic:

https://community.qlik.com/search.jspa?q=variable+parameter+comma+marcus

- Marcus

View solution in original post

1 Reply
marcus_sommer

I don't want to say that's not possible to get such a construct to work but I think that your nesting of variables which also contain nested variables is an overuse of variables respectively the idea behind them - which is mainly to simplify things.

In my opinion are the efforts to develop and maintain here a stable solution much higher as the benefit (and there is always a risk that you couldn't include all needed functionalities or parameters).

Therefore I suggest to rethink your whole approach. Nevertheless if you want to continue with your approach you will find here multiple postings to this topic:

https://community.qlik.com/search.jspa?q=variable+parameter+comma+marcus

- Marcus