Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to make new variable?

Good day QlikCommunity,

Is it possible to make a new variable? I want to create a variable Sum if I add my TotalPay and penalty.

Please leave your comment and advice.

Thanks in advance

1 Solution

Accepted Solutions
vardhancse
Specialist III
Specialist III

Yes we can create one variable:

Variable Overview(Ctrl+Alt+v) new variable

vExpression

Value: TotalPay + penalty

In chart expression use variable instead of expression: $(vExpression)

View solution in original post

8 Replies
robert_mika
Master III
Master III

Could you give more details?

Do you want to create this variable in scrip or front end?

Chanty4u
MVP
MVP

hi,

can u provide  exac output snap shot.

and sample data if possible.

Thank you

Suresh

Not applicable
Author

Hi Robert,

I want to create the Sum of TotalPay and Penalty on Script.

By the way here is the table. My expression on the sum is TotalPay+penalty, Is it possible to create a new variable to use it as an expression?

Thanks in advance sir

 

year1qtr1payeeTotalPaypenaltyTotalPay + penalty
TotalTotalTotal81201.486960.0688161.54
20131 183.7857.9241.68
20131xxxx4704.121482.126186.24
20132 178.7452.86231.6
20132xxxx4575.241353.245928.48
20133 171.245.32216.52
20133xxxx4381.921159.925541.84
20134 163.6837.78201.46
20134xxxx4188.6966.65155.2
20141xxxx3995.28773.284768.56
20142xxxx3866.4644.44510.8
20143xxxx3608.64386.643995.28
20144xxxx2899.802899.8
20151Allen Chi Ong128.520128.52
20151George A. ong20.4020.4
20151Marlyn Serrano40.8040.8
20151Patricia Sabrina Narciso193.80193.8
20151Rolando Balle & Rosemarie11687.5011687.5
20152Allen Chi Ong128.520128.52
20152George A. ong20.4020.4
20152Marlyn Serrano40.8040.8
20152Patricia Sabrina Narciso193.80193.8
20152Rolando Balle & Rosemarie11687.5011687.5
20153Allen Chi Ong128.520128.52
20153George A. ong20.4020.4
20153Marlyn Serrano40.8040.8
20153Patricia Sabrina Narciso193.80193.8
20153Rolando Balle & Rosemarie11687.5011687.5
20154Allen Chi Ong128.520128.52
20154George A. ong20.4020.4
20154Marlyn Serrano40.8040.8
20154Patricia Sabrina Narciso193.80193.8
20154Rolando Balle & Rosemarie11687.5011687.5
vardhancse
Specialist III
Specialist III

Hi,

We can create variable in 2 ways:

Alt+Ctrl+V(Variable Overview) click on new variable->value

Using Set and Let in script.

Not applicable
Author

Hi Suri,

I provided the table up there. I want to know is it possible to make a variable and use it to expression to show the Sum of two data.

Not applicable
Author

Hi Sasi,

can you teach me how it is done in script??

vardhancse
Specialist III
Specialist III

Yes we can create one variable:

Variable Overview(Ctrl+Alt+v) new variable

vExpression

Value: TotalPay + penalty

In chart expression use variable instead of expression: $(vExpression)

vardhancse
Specialist III
Specialist III

in script,

enter like SET vExpression=TotalPay + penalty;

and after reload only we can use the variable.

In chart expression use variable like $(vExpression) instead of direct expression.

Or else u can add variabel using variable overview as well and for this not required any reload.