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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Current Selections to govern calculations in Script

Hi, can you give a new to QlikView guy some help.

I have cribbed my calendar and set analysis stuff from a forum posting "PointInTimeReporting" and built further on that to add on Fiscal calendar data.

I now have a single calendar that contains an entry for each date. Each data has both calendar and fiscal calendar data against it.

My application offers the user 2 sets of list boxes - 1 for calendar Year and Month, the other for Fiscal year and Period ( [ Fin Year] and Fin_Period ).

I am trying to build the majority of logic into my script to keep chart expressions as simple as possible.

I have set up variables one of which is vSelectedCalYear with a definition

If

(ISNull(GetFieldSelections(Fin_Period)) AND ISNull(GetFieldSelections([Fin Year])), 'Year', 'F.Yr')



I was hoping to use this in the script to detect which of the 2 calendars the user has selected from but I get an error indicating that the GetFieldSelections is illegal in the script.

Is there an (easy) alternative way to govern which calculations are performed in the script based on whether the user selected calendar or Fiscal dates?

Any help greatly appreciated.

2 Replies
Anonymous
Not applicable
Author

Tony,
Using "actions" or macros, you can capture field selections into variables, and variables can be used in the script.

Not applicable
Author

Sorry for not responding sooner Michael. Many Thanks for you help, it has put me on the right track I think. Really appreciate it. Best Regards. Tony.