Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an expression ---=Sum({$<Date={"<=$(vInputDate)"},CLEAR_DATE={0,">$(vInputDate)"}>} Value_$(vAB))
I want to use this and create two columns in my straight table one with positive values and the other with negative.
I also want to create two pivot tables with these columns.
1. For positive column
-Straight Table: The rows are working as expected but the totals are also including the neg value.
-Pivot Table: The Total again in incorrect and is including the negative values. The dimension for which the overall result is negative is not showing subtotals.
2. For Neg column
-Straight table: Total shows zero.
-Pivot Table: No total. The subtotal is only being shown for the dimension that aggregates to negative.
===================
Here is a sample version of type of data and the qlik straight tables n pivot tables I am getting.
Expressions I use for two columns:
Positive:
If(Sum({$<Date={"<=$(vInputDate)"},CLEAR_DATE={0,">$(vInputDate)"}>} Value_$(vAB))>0,
Sum({$<Date={"<=$(vInputDate)"},CLEAR_DATE={0,">$(vInputDate)"}>} Value_$(vAB)),0)
Negative:
If(Sum({$<Date={"<=$(vInputDate)"},CLEAR_DATE={0,">$(vInputDate)"}>} Value_$(vAB))<0,
Sum({$<Date={"<=$(vInputDate)"},CLEAR_DATE={0,">$(vInputDate)"}>} Value_$(vAB)),0)
For Pivot, use the aggr function with dimensions used in table, so both straight table and Pivot table values get match.
Eg, Aggr(sum(ABC),Dim1,Dim1..)
Hi,
The straight table and pivot table are matching in all the values even now.
The main issue is with the subtotals and totals. If you can check the screenshot I have shared, the subtotals/totals are not summing the rows as is but taking all the values(positive/negative)