Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi'
i have this table -
cust | date | hours |
---|---|---|
A | 1.1.14 | 9 |
B | 2.1.14 | 9 |
C | 3.1.14 | 9 |
A | 1.1.14 | 9 |
C | 2.1.14 | 9 |
I WANT TO GET THIS -
CUST | HOURS |
---|---|
A | 9 |
B | 9 |
C | 18 |
I WANT IT TO SUM FOR EACH CUST THE HOURS BUT ONLY FOR DISTINCT DATES.
LIKE- 'A' have two records with the date -1.1.14 so it need to count it only once...
hope its clear
TNX
Do you have rows where cust and date are same and hours are different?
Tab1:
Load distinct * Inline [
cust,date,hours
A,1.1.14,9
B,2.1.14,9
C,3.1.14,9
A,1.1.14,9
C,2.1.14,9 ];
Final:
Load cust,sum(hours)Resident Tab1 group by cust;
NO
BAT I HAVE MORE COLUMN IN THIS TABLE AND IS THOSE COLUMNS THE DATA ARE DIFFERENT
Tab1:
Load distinct cust,date,hours Inline [
cust,date,hours,col1,col2
A,1.1.14,9,1,2
B,2.1.14,9,11,22
C,3.1.14,9,22,33
A,1.1.14,9,44,55
C,2.1.14,9,66,77 ];
Final:
Load cust,sum(hours)Resident Tab1 group by cust;
I DONT WANT TO CREAT ANOTHER TABLE,
I WAND AN EXPRESSION THAT CAN MAKE IT.
SOMETHING LIKE:
SUM({DISTINCT DATE} HOURS) ?!?!?!?
can you post a sample app?
and capslock broken?
In Qlikview, it shows only distinct values in straight table.
Can you please share QVW.
Try this expression,
SUM({<DISTINCT DATE, CUST>} HOURS)
i cant share a sample because i dont have QV in the computer with the internet.
i will try to do it more clear:
i have this table -`
cust | date | Work | Available hours |
---|---|---|---|
A | 1.1.14 | 2 | 9 |
B | 2.1.14 | 3 | 9 |
C | 3.1.14 | 4 | 9 |
A | 1.1.14 | 5 | 9 |
C | 2.1.14 | 6 | 9 |
I WANT TO GET THIS -
CUST | Available HOURS | Work Hours |
---|---|---|
A | 9 | 7 (2+5) |
B | 9 | 3 |
C | 18 | 10 (4+6) |
i want in the available hours column to sum for each sust his available hours but not sum twise for the same date.
the work hours should just do - sum(work hours)