Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

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
Employee
Employee

Re: How to use Total in a if sentense in QLIK SENSE

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

3 Replies
sinanozdemir
Valued Contributor III

Re: How to use Total in a if sentense in QLIK SENSE

Can you post a sample app or data?

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

Employee
Employee

Re: How to use Total in a if sentense in QLIK SENSE

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

Re: How to use Total in a if sentense in QLIK SENSE

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