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

How to use Total in a if sentense in QLIK SENSE

hi, im new to qlik sense and i have been searching for a way to do the following:

i have the following table:

Capture.JPG

and i need to calculate the return of those values, so i defined a variable with the first date

vFecha_Inicial = minstring(fecha)

and at the table i used the following code:

sum(TOTAL <valor_cuota> if( fecha  = vFecha_Inicial,aggr(sum(valor_cuota), fecha, fondo_id )))- 1

but it gives me:

Capture.JPG

which is the sum of the two rows. how do i get the values without using sum? so in every date i have the values of the first date?

any help is greatly appreciated. thanks!

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Try using the first() function to grab the left most 'fecha'

The percent growth from the first month is:

sum(Sales) / first(    Sum(Sales))

Capture.PNG

View solution in original post

3 Replies
sinanozdemir
Specialist III
Specialist III

Can you post a sample app or data?

However, you may try if(fecha = $(vFecha_Inicial) instead.

JonnyPoole
Employee
Employee

Try using the first() function to grab the left most 'fecha'

The percent growth from the first month is:

sum(Sales) / first(    Sum(Sales))

Capture.PNG

Not applicable
Author

that was extactly what i was searching for!, thank you!! a lot!!