Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Contributor III

Date Difference in pivot Table by Dimension Values

Hello,

I have a pivot table that looks like below:

TypeStart DateEnd Datediff
T11/9/20201/17/2020-
T11/18/20201/23/20201
T11/25/20201/27/20202
T22/1/20202/4/20205
T22/6/20202/9/20202
T32/11/20202/13/20202

 

Where diff column is the difference between the Start Date of current row and End Date of the previous row, which I have used the expression =(([Start Date]) - Above(TOTAL [End Date])). But what I want is the table shown below:

TypeStart DateEnd Datediff
T11/9/20201/17/2020-
T11/18/20201/23/20201
T11/25/20201/27/20202
T22/1/20202/4/2020-
T22/6/20202/9/20202
T32/11/20202/13/2020-

 

Basically I want the 'diff' column to reset each time the dimension value changes. How do I change my expression to achieve this? Thanks in advance!

 

@Gysbert_Wassenaar @tresesco @sunny_talwar 

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Date Difference in pivot Table by Dimension Values

You can just include an if clause like:

If(Type= Above(Total Type), <Your Existing exp>)

View solution in original post

2 Replies
Highlighted
MVP
MVP

Re: Date Difference in pivot Table by Dimension Values

You can just include an if clause like:

If(Type= Above(Total Type), <Your Existing exp>)

View solution in original post

Highlighted
Contributor III

Re: Date Difference in pivot Table by Dimension Values

Oh boy! I was trying the same thing: if(Type=Above(Type),Exp) and it wasn't working. Looks like i missed the important TOTAL parameter. Thanks a lot @tresesco ! Appreciate it.