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

Periods of dates in pivot table

Hi guys!

I have a table with a number of items came in or out in each stock for each day.

For example:

DateStockIteminORout
03.06.16Stock1Item13
04.06.16Stock1Item1-2
02.07.16Stock1Item22
10.07.16Stock1Item2-1
14.07.16Stock1Item1-1

In Pivot table in the end should be:

Year-MonthItemBalance
06-2016Item11

07-2016

Item21
Item10

There also can be Quarter-Year or Week-Year instead of Year-Month.

Please help to solve it. Thank you very much!

11 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

All you need to do is create a flag in Script to identify the Last day. Something like this.

Load *,If(Date = Monthend(Date),1,0) as Monthend_Flag From Xyz;

Now go to pivot and put expression as

Sum({<Monthend_Flag = {"1"}>}Stock)

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

It is great! Very easy at the same time))

Thank you very much.

P.S. Little addittional informatio. To work for 100% we need to Floor() the MonthEnd(Date).