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

Pivot Table with YTD and detailed data

I have a pivot table with a YTD column that I need to calculate and detailed data by month.  I have tried setting an expression for the YTD column using set analysis with Sum, but when I add this then the dimension for the field MON does not work correctly in the pivot table.  I have attached the qvw where I have the YTD expression as a simple sum, so that you can see the data.  Below is what I have tried to set the expression to, but once I add this the MON dimension no longer works when I change it to "March".

 

sum( {1<MON = {'April', 'March'}>} [BU Volume] )

8 Replies
MayilVahanan

Hi,

     Try this,

    

         =Sum({$<Mon={'April','March'}>}[BU Volume])

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

No, it does not work, it does not add the 2 dollar amounts for April and March for a YTD.

What I am trying to do is if April is $5 and March is $3 then YTD would be $8. I need to clear the dimension MON in order to add the two values for March and April, I want the YTD to be $8 when I select a MON of April or March.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Your YTD expression should be

      Sum({<FY=,MON=,FM={">=$(=YearStart(Max(FM)))<=$(=Max(FM))"}>} [BU Volume] )

Celambarasan

Not applicable
Author

This is not producing YTD numbers. It still gives the value for the current month. For example, if April is $5 and March is $3 then it is giving the YTD as $5 for April and $3 for March, it should be $8 for March and $8 for April.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

      Sum(TOTAL <FY>{<FY=,MON=,FM={">=$(=YearStart(Max(FM)))<=$(=Max(FM))"}>} [BU Volume] )

Not applicable
Author

This gives me YTD for April, but not March.

MayilVahanan

Hi,

     Try this,

     =Sum(TOTAL{<MON={'April','March'}>}[BU Volume])

     Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

That worked, but the real data file does not have the MON field, it takes the FM field to determine the month by =Month(FM). So, in the dimension is “=Month(FM)” instead of MON, I have tried replacing “MON” with “Month(FM)” but that is invalid, any ideas?

=Sum(TOTAL{<=Month(FM)={'April','March'}>}[BU Volume])