Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Totals function - Auto and Sum

When i use 'Auto' in total fuctions the total value i get is 5.35% but when i choose 'Sum' in Total functions i get 3.24%.

The individual values are same for both Value 0 and Value 1 as formula i am using here is

($(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} Sales*0.01))')-1)/100


My question :

i want to get total value using expression, so i put total just before sales in the formula


($(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} total Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} total Sales*0.01))')-1)/100


and it gives me 5.35


How do i get 3.24 instead of 5.35 using expression ?

15 Replies
Anonymous
Not applicable
Author

Thanks Sunny but it doesnt work, i tried this already

Anonymous
Not applicable
Author

I tried GetFieldSelections(Dimension) there but doesnt work

sunny_talwar

GetFieldSelections(Dimension)? What is this? What is the dimension that you use in your chart?

sunny_talwar

I attached a sample, did you check that? Attaching again with an image

Capture.PNG

Anonymous
Not applicable
Author

Hi Sunny Talwar,

This formula works

Sum(Aggr(

($(='(1+Sum({<B=Comp,DateField={"' & GetFieldSelections(DateField,'"}>} Sales*0.01)) * (1+Sum({<B=Comp, DateField={"') & '"}>} Sales*0.01))')-1)/100

, YourDimensionsHere))


but i am only able to add one dimension here. But if i use that pick formula here for dynamically choosing dimension it becomes 0.

sunny_talwar

There are too much back and forth between two threads of yours and I am confused what is your dimension? Have you tried this?

=Exp(Sum(Aggr(Log(1+Sum({<TimeKey = {"$(='>=' & Date(Min(Date#(Start_Date, 'YYYYMMDD'))) & '<=' & Date(Max(Date#(End_Date, 'YYYYMMDD'))))"}>}Sales)), TimeKey,

$(=If(GetSelectedCount(Select_1st_Dim) = 1,

Pick(Match(GetFieldSelections(Select_1st_Dim),'ABC', 'DEF'), 'ABC', 'DEF'),

'ABC')) ))) - 1