Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum column incorrect

I must load from a csv file to qlik sense a csv table in this way:

[dashboard_data]:

LOAD [giorno_full],

  [anno],

  [mese],

  [giorno],

  [cliente_id],

  [cliente],

  [zona_id],

  [zona],

  [struttura_id],

  [struttura],

  [area_id],

  [area],

  Num#(cost,'0.00') as costo,

  Num#(revenue,'0.00') as ricavo

FROM [lib://prove/dashboard_data.csv]

(txt, utf8, embedded labels, delimiter is ';', msq);

This is the head of the csv file:

"giorno_full";"anno";"mese";"giorno";"cliente_id";"cliente";"zona_id";"zona";"struttura_id";"struttura";"area_id";"area";"cost";"revenue"

"2014-06-13";2014;6;13;36;"DOLOMITI4U DI GHEDINI BRUNO";9;"Cortina d'Ampezzo";22;"Dolomiti4u";30;"Area Veneto 1";56.98;60.00

"2014-06-16";2014;6;16;36;"DOLOMITI4U DI GHEDINI BRUNO";9;"Cortina d'Ampezzo";22;"Dolomiti4u";30;"Area Veneto 1";77.93;88.00

"2014-06-18";2014;6;18;36;"DOLOMITI4U DI GHEDINI BRUNO";9;"Cortina d'Ampezzo";22;"Dolomiti4u";30;"Area Veneto 1";83.91;96.00

"2014-06-19";2014;6;19;36;"DOLOMITI4U DI GHEDINI BRUNO";9;"Cortina d'Ampezzo";22;"Dolomiti4u";30;"Area Veneto 1";24.06;0.00

However when I create a measure with "sum(revenue)" or "sum(cost) the sum is incorrect (incredibly high)... which are the reasons? There are other ways to find those sums?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Is this also to high when you select e.g. a single date or record?

Could you show some samples how the numbers look like?

I've noticed that you are using num#() function interpret your numbers. Which settings for decimal and thousand separator are you using? Maybe it's helpful to make them explicite:

Num#(cost,'0.00','.',',') as costo,

  Num#(revenue,'0.00','.',',') as ricavo

View solution in original post

4 Replies
swuehl
MVP
MVP

Is this also to high when you select e.g. a single date or record?

Could you show some samples how the numbers look like?

I've noticed that you are using num#() function interpret your numbers. Which settings for decimal and thousand separator are you using? Maybe it's helpful to make them explicite:

Num#(cost,'0.00','.',',') as costo,

  Num#(revenue,'0.00','.',',') as ricavo

Not applicable
Author

Hi Michele,

I am attaching an sample app. Please let me know the number is coming right or not as per your requirement.

Not applicable
Author

Ok thanks the answer is correct!

Anonymous
Not applicable
Author

Please mark Stefan's answer as CORRECT if it answered your question.

Thanks!