Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Subtraction

Hi All,

I have a query in qlikview , i have attached a image file where in i have 2 columns flag and amount, i need to subtract Gross-RI in qlikview in table , how to use that.

4 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Sum({<Flag={'Gros'}>} Amount) - Sum({<Flag={'RI'}>} Amount)


-Rob

Highlighted
MVP
MVP

maybe this expression

if(Dimensionality()=0, sum({$ <Flag*={Gross}>} Amount) - sum({$ <Flag*={RI}>} Amount), sum(Amount))

1.png

Highlighted
MVP
MVP

S:

load *, rowno() as id inline [

Flag, Amount

Gross,34

Gross,21

Gross,21

RI,12

RI,34

RI,23

];

Link:

LOAD

    id,

    Flag as NewFlag,

    1 as PM

Resident S;

Concatenate(Link) LOAD

    id,

    'Net' as NewFlag,

    if(Flag = 'Gross', 1, -1) as PM

Resident S;



Dimension    NewFlag

Expression    sum(Amount * PM)

1.png

Highlighted
Contributor III
Contributor III

Thanks