Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How variables can be used to calculate any value by matching the data in the field?

hii All,

i want to perform calculation on some value based on their codes like:

table 1

col     code     value

A     1               100

B     2               -

C     3               200

D     4               -

E     5               300

resultant table will be:

col     value

A     100

B     C+A

C     200

D     B-C

E     300

i have to make it using variables

2 Replies
amitarusi
Contributor III
Contributor III

why do u have to use variables?

isn't this good enough ?

A:

LOAD COL,

     VALUE

FROM

excel.xlsx

(ooxml, embedded labels, table is SHEET1)

Where NOT IsNull(VALUE);

Concatenate

LOAD

'B' AS COL,

SUM(VALUE) AS VALUE

resident  A

Where MATCH(COL,'C','A');

Not applicable
Author

Hii and thanks,

As this is only a simple table which i made here,

my table is quite large and this is not like i have to just sum two data values there is multiple airthmatic operations are used to find out the data value ,and the data's which is used here to calculate another data values are a part of the same data colmn , i have only a single way to solve it that is using variable and col having code regarding each data.

Another reason is i dn't want to change any necessary data completely using script, so i want to use expression.

and the resultant table i made above is a pivot chart, sorry for the mistake.