
Anonymous
Not applicable
2018-01-26
05:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count distinct on a if-variable condition
Hi,
I need some help to set a formula.
I have a variable, vStock, that calculate the items stock at a given date:
SUM({$<StockDate={">=$(=MIN(DateInit))"}>*$<StockDate={"<=$(=MIN(DateEnd))"}>} Quantity )
I'm trying to count the distinct items where stock is greather than zero, for example:
COUNT DINTINCT [Item] WHERE [vStock]>0
After some research I find out this formula, but is very slow (and I don't know if it is correct):
COUNT(DISTINCT AGGR(if($(vStock)>0, Item), Item))
There is another, simple way to calculate this without Aggr and/or If statement?
1,532 Views
1 Reply


MVP
2018-01-27
06:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gabriele,
What about this:
Count({<ITEM={"=$(vStock)>0"}>} Distinct ITEM)
Cheers
Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
1,256 Views
