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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HOWTO create a table of variables witch can be edited by QV user?

hellow there,

I`d like to create a bunch of variables (in some kind of structure like table or sth.) witch can be edited by QV user and this variables affects the results presented in application.

The problem is connected with currency exchange defined by every month-year, so the QV app user can edit structure like below:

  Table 1.

CurrencyBook MonthRate
USD2011-06-012.75
USD2011-05-012.77
USD2011-04-012.91
USD2011-03-012.94
USD2011-02-012.88
USD2011-01-013.05
EUR2011-06-013.95
EUR2011-05-013.99
TND2011-04-014.06
EUR2011-03-014
GBP2011-02-013.89
EUR2011-01-014

Lets say we give him a possibility to select single 'Currency+Book_Month' and then edit 'Rate' using Spinner component.

Looking at the data logic we have a product bouhgt in some date, which contains a parts - each part`s cost is described in different currency with Rate determined by 'Currency' and 'Book_Month' from table above.

For specific product we calcuate real cost transfering all costs in to one currency calculating it using table   'Table 1' and combining it by Table2.'Book date' with  Table1.'Book Month' and Table1.'Currency' with Table2.Part_1_Currency, Table2.Part_2_Currency and Table2.Part_3_Currency.

Table 2.

Product_idBook datePart_1_CurrencyPart_1_CostPart_2_CurrencyPart_2_CostPart_3_CurrencyPart_3_Cost
12011-06-23USD39EUR56TND75
22011-05-04EUR56EUR78TND89
32011-02-23GBP34EUR23MAD32


QV User by editing currency rates in 'table 1' can speculate how high product`s cost could be if the currency rate changes. 'Table 1' can be staticly set at the begining and then while changing by user product`s cost will be recalculated.

Questions:

1. how to dynamicly define in QV structure of variables  like in 'Table 1' and connect them with QV component, in order to changing them by user, wihout reloading all application? (defining a single variable multiple times and managing it is realy annoying).

2. If we make a pivot with aggregation   sum(product`s_cost) how to dynamicly calculate cost_of_all_products while assumpions in 'Table 1' are being changed by QV user? maybe use an external funtion witch takes as args. info about product, then calculates cost based on Table1? But I don`t have a clue if this kind of funtions can be written in qv scripting? maybe it has to be external written in VBA, Python...?

thanks for any ideas with this stuff.

0 Replies