Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community
this is my table
Date | Unit Cost | Quantity |
---|---|---|
01.01.2016 | 10 | 5 |
01.01.2016 | 10 | 3 |
01.04.2016 | 50 | 4 |
01.10.2016 | 100 | 3 |
01.10.2016 | 10 | 5 |
01.10.2016 | 200 | 2 |
01.10.2016 | 150 | 4 |
How can I get the total cost sum([Unit Cost]*Quantity) for the last date 01.10.2016 ?
QV should return: 100*3 + 10*5 + 200*2 + 150*4 = 1350
It repeats the same number for each of your date
But this is sort of working
=(1-(1/(sum({<contract_begin = {"$(=Date(Max(contract_begin), 'DD.MM.YYYY'))"}>} cost_acquisition*cost_rate_reg_perc*(contract_term_reg)))*sum({<contract_begin = {"$(=Date(Max(contract_begin), 'DD.MM.YYYY'))"}>} cost_acquisition*cost_rate_reg_csc_perc*(contract_term_reg))))
Your date format is not MM.DD.YYYY, it is DD.MM.YYYY
Not sure, but may be this is what you are looking for
Sum({<Date = {"$(=Date(Max(Date), 'MM.DD.YYYY'))"}>} [Unit Cost]*Quantity)
In the expression QV says "Expression OK" but it still returns me "Error: E..."
My proper function looks different from the example. I exactly paste in the fields I need. Can you have a look on my real function?
=Sum({<contract_begin = {"$(=contract_begin(Max(contract_begin), 'MM.DD.YYYY'))"}>} (1-(1/(sum(cost_acquisition*cost_rate_reg_perc*(contract_term_reg+lm_term)))*sum(cost_acquisition*cost_rate_reg_csc_perc*(contract_term_reg+lm_term)))))
Hahahaha my bad I didn't differentiate between your date and date() function... try this
=Sum({<contract_begin = {"$(=Date(Max(contract_begin), 'MM.DD.YYYY'))"}>} (1-(1/(sum(cost_acquisition*cost_rate_reg_perc*(contract_term_reg+lm_term)))*sum(cost_acquisition*cost_rate_reg_csc_perc*(contract_term_reg+lm_term)))))
I still have the same error See here
The object which returns Error: E... is an Textobject
Does this expression work without the set analysis part? May be there is something else which is wrong and set analysis works fine?
I dont know, actually I dont have any idea. Ive thought that set analysis would be the right way.
Would you be able to share your qvw?
I just attached the qv file