Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
absekrafi
Creator III
Creator III

Adding two Table columns

Hi Qlikview Experts,

I am new to Qlikview and I want to add to columns of a Table. The Table is a result of a concatenation of 2 Tables. Please find attached the Table (result of concatenation).

This my script code but it didn't work (the decimal separator is ',' and the thousands separator is either space or null):

Directory;

LOAD CODUSN,

     CODEART,

     TRANSACTION_DATE,

     CODESART,

     TYPEART,

     CODUNT,

     QUANTITE,

     NATIO,

     CODUSNSRC_DST,

     QTERED,

     Num( QUANTITE, '###0,###', ',' , ' ' ) + Num(QTERED, '###0,###', ',' , ' ') AS QUANTRED

FROM

[..\..\..\personnel\Qlickview\QVD\TRANSFERT.qvd]

(qvd);

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi ,

Writethe conddition is like below.


Num( QUANTITE, '###0,###', ',' , ' ' ) &'-'& Num(QTERED, '###0,###', ',' , ' ') AS QUANTRED

View solution in original post

12 Replies
Anonymous
Not applicable

Hi ,

Writethe conddition is like below.


Num( QUANTITE, '###0,###', ',' , ' ' ) &'-'& Num(QTERED, '###0,###', ',' , ' ') AS QUANTRED

olivierrobin
Specialist III
Specialist III

hello

if you want to add the 2 columns

why don't you use

Num( QUANTITE+QTERED, '###0,###', ',' , ' ') AS QUANTRED

?

gerry_hdm
Creator II
Creator II

you used

RANGESUM()

gerry_hdm
Creator II
Creator II

Rangesum(num(QUANTITE) ,num(QTERED) )  AS QUANTRED

so is correktly

this sum all numfielsd

Anonymous
Not applicable

Use & operator to concatenate like below.


Column1 & ' ' & Column2 as Column 3


ramasaisaksoft

Hi Abdallah,

you can achieve this like below

Way 1:-

T1;

LOAD CODUSN,

    CODEART,

    TRANSACTION_DATE,

    CODESART,

    TYPEART,

    CODUNT,

    QUANTITE,

    NATIO,

    CODUSNSRC_DST,

    QTERED,

    QUANTITE,

      QTERED

FROM

[..\..\..\personnel\Qlickview\QVD\TRANSFERT.qvd]

(qvd);

Load *,

Num( QUANTITE, '###0,###', ',' , ' ' ) + Num(QTERED, '###0,###', ',' , ' ') AS QUANTRED

Resident T1;

Drop  Table T1;

Way 2:-

Example i am giving here

LOAD

    uniqueid,

    residentialunitprice,

    maintenancefundprice,

    totalcustomizationcharges,

    totalservicetax,

    totalvat,

    wc,

    Rangesum(residentialunitprice, maintenancefundprice, totalcustomizationcharges, totalservicetax, totalvat, wc) as S_TotalCharges,

FROM

[tesaleorde.qvd]

(qvd);

In RangeSum() you have give comma not + symbol.

vishalarote
Partner - Creator II
Partner - Creator II

Do one condition

if(QTERED=null(), QUANTITE,

if(QUANTITE=null(),QTERED

if(QTERED=null() and QUANTITE=null(),null(),QUANTITE+QTERED)))as QUANTRED


I hope it will works.



qv_testing
Specialist II
Specialist II

HI,

PFA,

vishalarote
Partner - Creator II
Partner - Creator II

try this it will work

demo e.g.

load *,

If(len(trim(v1))= 0,v2,if(len(trim(v2))= 0,v1,v1+v2)) as new;

LOAD * INLINE [

    id, v1, v2

    1, , 2

   

    2, , 5

    3, , 8

    4, 12

    5, 54

    6, 89

    7, 55

    8,6,8

    9,2,3

];