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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Daryn
Creator
Creator

% of when using sum of multiple fields gives wrong result

Hi to all and thanks in advance as always for your help and support.

I have to sums that both work correctly on their own.

Sum 1 (sum of purchasing spend)=

Sum({< [ZKPI_PUR_RATIO.PERIO.autoCalendar.Year] = {"$(=Year(Today()))"}>} [ZKPI_PUR_RATIO.EKWRT])

Sum 2  (sum of sales)=

Sum ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >} [NETWR])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[DKK_€])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[GBP_€])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[HUF_€])

 

Results sum 1 on left sum2 on right:

Daryn_0-1657007104789.png

 

However, when I try to combine these sums and divide then *100 for a % (as you normally would), I get the wrong result.

For example they should result in approx 57%

The fields in sum 2 are the conversions of the different currencies into €. Each of these originate from a separate table.

Sum({< [ZKPI_PUR_RATIO.PERIO.autoCalendar.Year] = {"$(=Year(Today()))"}>} [ZKPI_PUR_RATIO.EKWRT])
/
Sum ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >} [NETWR])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[DKK_€])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[GBP_€])
+ SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[HUF_€])*100

results in -

Daryn_1-1657007572162.png

As usual, I am sure my lack of Qlik interpretation is to blame, but they say there is never a silly question!

What am I doing wrong please?

Thanks kindly, Daryn.

 

 

Labels (1)
1 Solution

Accepted Solutions
Daryn
Creator
Creator
Author

Fixed it with;

=(Sum({< [ZKPI_PUR_RATIO.PERIO.autoCalendar.Year] = {"$(=Year(Today()))"}>} [ZKPI_PUR_RATIO.EKWRT])
/
(Sum ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"}, WAERK = {'EUR'} >} [NETWR])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[DKK_€])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[GBP_€])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[HUF_€]))))))

 

and displaying as;

Daryn_0-1657106471304.png

 

Shown under the spend gauge.

Daryn_1-1657106510863.png

 

View solution in original post

1 Reply
Daryn
Creator
Creator
Author

Fixed it with;

=(Sum({< [ZKPI_PUR_RATIO.PERIO.autoCalendar.Year] = {"$(=Year(Today()))"}>} [ZKPI_PUR_RATIO.EKWRT])
/
(Sum ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"}, WAERK = {'EUR'} >} [NETWR])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[DKK_€])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[GBP_€])
+ (SUM ({< [FKDAT.autoCalendar.Year]= {"$(=year(Today()))"} >}[HUF_€]))))))

 

and displaying as;

Daryn_0-1657106471304.png

 

Shown under the spend gauge.

Daryn_1-1657106510863.png