Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Dynamic Straight Table Calculations

I have a straight table and what to SUM() what is selected within a list box. However, within the list box is only each divisions name, such as Finance, HR, etc. When I originally imported my data from each division I used qualify, thus for a given metric such as PLAN, the field is named Finance.PLAN or HR.PLAN. Thus within my straight table I want to sum PLAN and FORECAST individually. In order to do this I have written the following, however I keep getting an error message that states: Error: Error in expression: Nested aggregation not allowed. Is there anyway to script what I'm trying to do?

=Sum(Concat(getfieldselections([Divisions])&' .Plan'))

1 Solution

Accepted Solutions
krishna_2644
Valued Contributor III

Re: Dynamic Straight Table Calculations

See attached files.

let me know if you have any questions

24 Replies
krishna_2644
Valued Contributor III

Re: Dynamic Straight Table Calculations

Not sure you want this kind but See attached doc.

Capture1.PNG

Capture2.PNG

Capture3.PNG

Not applicable

Re: Dynamic Straight Table Calculations

Yes, however, when I select the division, it sum() the PLAN for every metric, when in actuality I want to select a division, and when selected it will compute PLAN for each metric in separate rows of the straight table

krishna_2644
Valued Contributor III

Re: Dynamic Straight Table Calculations

post some sample data.

krishna_2644
Valued Contributor III

Re: Dynamic Straight Table Calculations

Any luck?

Not applicable

Re: Dynamic Straight Table Calculations

No, still no luck, I have 10+ divisions, and only want them to display 2-3 calculations only when selected

krishna_2644
Valued Contributor III

Re: Dynamic Straight Table Calculations

post some sample data.

Re: Dynamic Straight Table Calculations

I didn't understand your question. Can you please explain with example

mvanlutterveld
Contributor II

Re: Dynamic Straight Table Calculations

Hi Michael.

IMHO The solution should be in the script and not in the front end calculations. Create a fact table with all the metrics you need and the key fields to the dimensional tables like Division, Calendar. Advantage of this approach is that you don’t have to qualify your fields.

Cheers,

Michiel

Not applicable

Re: Dynamic Straight Table Calculations

Its a bit difficult to post all the data but a screenshot is below. Here is what I am trying to accomplish:

1) Limit selections within Divisions to one, and once one is selected it dynamically updates the straight table

2) When the division is selected, the straight table will display that divisions metrics, in addition to the plan, actual, and forecast for each respectively

3) Each division and metrics are in separate tables, thus have been qualified, so something needs to follow along the lines of

=IF(GETSELECTEDCOUNT([Divisions]) =0,0, CONCAT(GETFIELDSELECTION([Divisions])&' Data.Metric')

Community Browser