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: 
Not applicable

ValueList() Not working when using variable... help?

Hey, Qlik Community:

I'm trying to save sheet real estate by combining charts using the Variable extension and find that when using it in conjunction with ValueList(), I get the message 'The selections generated no data for this chart.' Here's the setup:

Variable extension with 2 values:

     Variable name: vChartToggle

     Value 1: 0

     Value 2: 1

Target Visualization: Line Chart with 2 dimensions and one metric:

     Dimension 1: 

          IF($(vChartToggle)=0, [YYYYMM],IF($(vChartToggle)=1,[MONTH_NAME]))

     Dimension 2:

          IF($(vChartToggle)=0,VALUELIST('Actual','Plan'),IF($(vChartToggle)=1,[YEAR_INT]))

     Metric 1:

          IF($(vChartToggle)=0,

               PICK(MATCH(VALUELIST('Actual','Plan'),'Actual','Plan'),($(func_KPI('Actual','R13M'))),($(func_KPI('Plan','R13M')))),

         IF($(vChartToggle)=1,SUM( {<

                                                          SCEN={'A'}

                                                         ,[Reporting_mo_anchor.YYYYMM]={'$(_ReportingYearMonth2)'}

                                                         ,[Reporting_mo.rte_code]={'YTD','YTDPY'}

                                                       >} Premium)))

It is important to note that when the variable is set to 1 (i.e. $(vChartToggle)=1) the chart works as expected. It's only when the chart value is set to 0 that it does not work. The charts also work if I separate them into two distinct charts without the use of a variable.


Anyone know any limitations on using ValueList() this way?

1 Reply
shraddha_g
Partner - Master III
Partner - Master III

didn't find anything wrong with expression.

Can you share Sample app..