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

Straight Table Dimension Minus Aggr Dimension

Hi all,

I need to, without putting a flag in the script, subtract the number of days between a dimension field and an aggregated value of that same dimension field.

In the attached example, I'm trying to find the number of days between each sale and the very first sale the employee made. Using aggr to find the first sale for each employee works fine in the first sale column, but when I subtract, it only shows the calculated value on the same row as the initial sale. Is it possible to return the calculated value on each row in the straight table without altering the script?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You could use this as calculated dimension =TX_DATE - date(aggr(NODISTINCT MIN(TX_DATE),EMP))

But you really should use expressions. See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You could use this as calculated dimension =TX_DATE - date(aggr(NODISTINCT MIN(TX_DATE),EMP))

But you really should use expressions. See attached qvw.


talk is cheap, supply exceeds demand
dclark0699
Creator
Creator
Author

This is exactly what I was trying to do. Thanks! I've never used NoDistinct before.