Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Not applicable

Declaring multiplw values in variables or using frontend variables for calculation

Hi All, i have a requiremnt where qlikview is unable to handle this. I have a variable say Vsales I have a front end input box in which im using this variable User can enter any value in the input box from 1 to 100 And the calculation im doing at the backend for this is sum (sales)*Vsales/100 as new_slaes This new_sales is my base data on top of it i have a lot calculations to be done Qlikview is unable to hadle it and i giess qlikview has a disadvante over other tools over here I even tried of declaring 1 to 100 numbers in this variable in the script and unable to achieve this Does qlikview cnnot handle thos kind of requirements

5 Replies

Re: Declaring multiplw values in variables or using frontend variables for calculation

I don't see a reason why QlikView should not be able to handle 100 variables. Would you be able to share a sample where it isn't working?

Re: Declaring multiplw values in variables or using frontend variables for calculation

In R you can use like you mentioned -- sum (sales)*Vsales/100

But qlikview need to know which is variable should use $(Vsales) then qlik capture

I have 4 notepads with all variables around each file showing 8 MB. I am sure it should more than 100 Variables or it may cross to 500 Variables too. My client didn't face any issue still i am using variables. May be behavior running in patch filed. Check and confirm the same

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable

Re: Declaring multiplw values in variables or using frontend variables for calculation

this is my actual code

Maintable:

load * inline
[

Emp_id,sales,purchases
1,100,250
2,300,450
4,190,74

];


Table:
LOAD Distinct
Emp_id,
(sum(DISTINCT sales)) as CA1,
(sum(DISTINCT purchases)) as CB1
Resident Maintable

Group by Emp_id;

set Vpercent=30;(here i want 10 20  40 50 60 70 80 90 100 as well  i want to multiply my sales with all these values so my variable  Vpercent should hold all the values)

table 2:

LOAD Distinct
Emp_id,
CA1*$(Vpercent)/100 as C11,
CB1*$(Vpercent)/100 as C12,
Resident
Table

my actual requirement is i have a input box in the front end where user can iput any input values

say if user has given value 20 then 20 % of my sales will come and this will be my base data and on top of this there will be more calculations

which i cnanot do with this iput box variable approach

can input field be useful herre

Not applicable

Re: Declaring multiplw values in variables or using frontend variables for calculation

I have an application that has around 600 variables and it works fine without any problems (but can be a bit slower to save).

adamdavi3s
Honored Contributor

Re: Declaring multiplw values in variables or using frontend variables for calculation

I don't think the OP is questioning the number of variables? Unless I am mistaken?

The issue is that the OP wants to apply a variable in a script to produce the base data and then reload from here.

The only way to do this would be to allow the user to set the variable and then allow them to reload the document, via desktop this is easy but via the server it is not so.

Or are you suggesting you want to generate columns for each of the percentages 1-100? if so then you can use this code:

Maintable:

load * inline

[

Emp_id,sales,purchases

1,100,250

2,300,450

4,190,74

];

Table:

LOAD Distinct

Emp_id,

(sum(DISTINCT sales)) as CA1,

(sum(DISTINCT purchases)) as CB1

Resident Maintable

Group by Emp_id;

for i=1 to 100  ;

  Concatenate (Table)

  LOAD Distinct

  Emp_id,

  CA1*$(i)/100 as 'CA1$(i)',

  CB1*$(i)/100 as 'CB1$(i)'

  Resident Table;

next i;

However, I don't see the reason why this can't be done in the front end, please see the attached example for some ideas, but without knowing your requirements it is hard to advise.