Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

Set analysis

Please, how can I do that?

I have fields date, month, year and quantity and wanna show in a dinamic table the sum of the quantities of the month and year selected, but I wanna sum the total of the days till the day that is selected.

Example: If I select day = 10, I wanna the sum of day 1 to day 10, not the other days.

How can I do that Please?

Thank You in advance

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

may be this

sum({<Day={"<=$(=max(Day))"}>}Value)

see the attached file

hope this help

Sunil Chauhan

View solution in original post

6 Replies
swuehl
MVP
MVP

Not sure if I undertstood correctly, maybe like

= sum({<date = {">=$(=monthstart(max(date)))<=$(=max(date))"} >} quantity)

Hope this helps,

Stefan

rcandeo
Creator III
Creator III
Author

I didn't got it.

Maybe I should put my code so you could help, sorry:

Sum({<Tipo_Apontamento={'Producao'}, Day=>} Quantity)

In the code above I've got the total of the selected month.

I wanna the total of the selected month till the selected day, so If I select day = 10, I wanna the total from 01/month_selected till 10/month_selected, disregarding the total of today (11)

swuehl
MVP
MVP

Ok,

try

=sum({<[Tipo Apontamento] = {'Producao}, Day = {"<$(=max(Day))"},Date= >} Quantity)

I assumed that you also have a Date field.

Hope this helps,

Stefan

rcandeo
Creator III
Creator III
Author

Great, but I would like a little different.

In this code that you showed me, it'll sum only the days that I have selected. Is there a way to sum till the maximum day selected?

Example:

Day     Value

1          10

2          15

3          20

4          15

5          30

6          20

7          20

8          30

9          10

10        11

11        5

In your code If I select Day = 10, it'll show me the total = 11 and I'd like to receive the sum of all the days before, incluindo day 10, that would be 181.

Thank You for helping me.

rcandeo
Creator III
Creator III
Author

Hi, can you help me with this?

SunilChauhan
Champion II
Champion II

may be this

sum({<Day={"<=$(=max(Day))"}>}Value)

see the attached file

hope this help

Sunil Chauhan