Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

How can I reverse the sign on QlikView ?

How can I reverse the sign on QlikView?

Hello everybody,

I've been using QlikView for about 4 weeks now and I'm getting it right

Nevertheless, I need your help ..

In my ERP system, the outgoing invoices are filled with transaction types. The formula itself works, however the occupancy type 'G' must be displayed as minus amount.

sum (

     {<

     Record Type = { 'R', 'G', 'O'},

Flag_Artikelfamilie_vorhanden = {1}

     >}

     rangesum (

#Sales,

-#Value

)

     )

At the moment, QlikView adds all sales from the individual occupancy types, so far so good. Type 'G' must be subtracted.

Can you help me?

Many Thanks

2 Replies
mov
Esteemed Contributor III

Re: How can I reverse the sign on QlikView ?

If you're satisfied with the expression, don't change it.  Instead, change the sign in the load script, something like:

if("Record Type"='G',-1,1)*Sales as Sales

Re: How can I reverse the sign on QlikView ?

Here's one option:


sum (

     {<

     Record Type = { 'R', 'G', 'O'},

Flag_Artikelfamilie_vorhanden = {1}

     >}

     rangesum (

#Sales * pick(match('R','G','O'),1,-1,1),

-#Value

)

     )