Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
francofiorillo
Partner - Creator
Partner - Creator

sum in pivot table with RowNo ()

Hello.
I need your kind help.
I have a pivot table, with three dimensions and different expressions.
With two variables, vDataMin and vDataMax, I limit the display of the lines only to those that have a value of <Data> included between these values.
On each line I calculate the number of days between the current line and the next line (column <Tot_Giorni>)
With the following expression

    sum (If (Data> = (vDataMin) and Data <= (vDataMax),
                        if (NextDate <= (vDataMax),
                                        Day,
                                        (VDataMax-Data)
                           )
                    )
            )

to this value I should add, for each article, the value present only in the first row (Val_Row_1 = 7, for example for article 40101653).
this value is calculated with the following expression
if (RowNo () = 1, sum (Data-vDataMin), 0)

having to use the pivot, in making the sum, while obtaining a correct value on the line (12 instead of 5) I cannot get a total of days for the correct article. In fact, for example, for the first article I always get 195 and not 202 (correct value)
can you suggest me how to write the sum of the columns for the pivot?
thank you in advance.
regards

Labels (2)
1 Reply
lfetensini
Partner - Creator II
Partner - Creator II

Hi my friend.
Try: RowNo(TOTAL)

Otherwise, upload your app to better help.
Support your colleagues. Remember to "like" the answers that are helpful to you and flag as "solved" the one that helped you solve. Cheers.