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

Variable column listbox

Our accounting year does not match the calendar year. Calendar year starts 01/01 but accounting year start 01/10 for example. My QVD files contain 2 different sets of periods : one according to the Accounting Period (also known as AY) and another one according the Calendar Period (known as CY).

The fields in the table related to the period look like this :

year_AY
year_CY
period_AY
period_CY
month_AY
month_CY

In my QV application, I would like to leave it up to the user whether he wants to see the data according to Calendar year (fields ending with CY) or Accounting year (ending with AY).

I have created an inputbox with variable vPeriodType with a dropdown list containing AY and CY as values. Listboxes can be created using an expression field. When I create a multibox, I am not able to sort on the expression. Is there a trick do to that ?

What is the best approach to build the QVW application ?

* Making list boxes, inputboxes, charts, ... variable as described above. How can I make the selections work then ? I could trigger an event on the input box that 'clears' or updates the selections (when user switches from AY => CY, clear selections on the _AY fields and set them on _CY fields. Is there a way to translate the selections performed ? Problem is that the user does not necessarily select year AND month AND period. It might only be 1 or 2 of them.

* Duplicating all sheets and implement a conditional show on each sheet. On the first set of sheets use _AY on all listboxes, charts, ... and on the second set use _CY.

The second approach is perhaps the least difficult to implement, but it looks very time consuming, as every change in the QV application would have to be performed twice (once on the _AY sheet and once on the _CY sheet). I haven't tested performance in sheets yet, but I guess as long as I do not use if else end expressions and only 'year_$(vPeriodType)', performance will not be affected. However I still need to be able to sort data, as it would not be user friendly to not sort periods in a list box / drop down box /... chart

Thanks for the input / suggestions

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

One solution for what you are trying is to use one or more cyclic groups, which will allow the user to select calendar/accounting on the charts directly.

Look up cyclic groups in the manual.

They can be created from the chart dimension tab (Edit Groups button) and in your example you would need a Year group (with year_AY and year_CY), a Period group and a Month group. Use one of these groups as a dimension on your charts.

Although you get to the groups on the dimension tab, they are global to the application. That is, if you create a group YearCG and use it as a dimension on more than one chart, selecting caleandar/accounting on the cyclic group affects all charts that use that dimesion.

One problem you may have is that selecting calendar year in one group does not automatically select calendar month in the month group or calendar period in the period group. You could colour code, using GetCurrentField(groupname) to see what is currently selected.

Hope this helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein