I have a pivot table visual, with 4 dimensions and 3 measures - please refer to the attached image.
I want to filter out records with Total Volume less than 20. Can I get some recommendation on how I can acheive that. Of the 4 dimensions, Origin City and Mode are calculated dimensions.
You can try something quick and dirty that will do the trick :
Sum(if(TotalVolume >= 20, TotalVolume))
It's valid for other measures, so you could also do :
Avg(if(TotalVolume >= 20, DaysToLoad)
The most efficient way would be to use a set analysis, something like :
Sum( {<TotalVolume = {">=20"}>} TotalVolume)
Related
I have a table that has budget amounts at Level 2 and amounts at Level 1. I have a slicer. when I select a value in the slicer, I need my dax to find its parent and show these levels (and blank() at the Level1). It is not a defined hierarchy, but I could make it one.
I am trying to produce the two results in the snip below. One example with D selected in the slicer, the results to its right. Second example is C... I can got my select value measure to work, but need help with "Budget $" measure
I am trying to write a budget measure that produces the results above.
Thanks,
Mike
You need to specify that you want the values from the Budget rows. Something like this:
Budget $ =
CALCULATE ( SUM ( Data[Value] ), Data[Type] = "Budget" )
This should replace the current type context (D or C in your example) with Budget.
I was wondering if there was a Graphite function or a way of getting the number of points above a certain value. Let's say I have 2,44,24,522,52,534 for the same time and I want to get the number of points over 40, in this case it would be 3. Any tips?
Thanks
You can use removeBelowValue(your.metric, 40) to only display points above 40.
Then use something to make non zero value equal to 1 (I am thinking of pow(_, 0) but I am not sure of how it behaves with None values given by removeBelowValue). If you use recent (>0.9.x) version of graphite, you can use isNonNull instead of pow
In the end you can use any function to summarize your the 1s you have, summarize you should be good. You only have to select your range.
Suggestion : summarize(pow(removeBelowValue(your.metric,40),0), '1hour', 'sumSeries')
i am currently trying to Group Values given to Pointers in a Gauge Panel.
The Scenario Looks like this:
Now i have a dataset with the following Fields:
KPIName
KPIValue
I have all the Values in KPIValue, and I Group them with the field KPIName since i currently have 4 different KPIValues.
What i want to accomplish now is to put in 4 different Pointers in my GaugePanel and let them Show each KPIValue, meaning I want them to be Grouped, or at least let each pointer individually be Filtered to the KPIName it is supposed to Show.
I am working with GaugePanels for the first time, but it doesn't really seem possible to me for now,
Is there a solution ?
Is there a way ?
Or at least a Workaround ? (like adding custom fields to the Data Set, which are filtered by KPIName, or something similiar ?)
Thanks a lot for your Help!
Set the expression for the pointers to
=Sum(IIf(Fields!KPI.Value = "KPI1", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI2", Fields!Value.Value, 0))
=Sum(IIf(Fields!KPI.Value = "KPI3", Fields!Value.Value, 0))
...
Is there a function in the Graphite URL API which allows us to ignore values which are inside (or outside) a certain range?
I believe you can check out the removeAboveValue and removeBelowValue functions.
For example, to exclude values below 2 and above 10:
http://host/render&target=removeAboveValue(removeBelowValue(a.b.c, 2), 10)
Ignoring values inside a range is a little more difficult, but it can probably be achieved by summing series where data has previously been filtered out (untested):
http://host/render&target=sum(removeAboveValue(a.b.c, 2), removeBelowValue(a.b.c, 10))
I and my coworkers enter data in turns. One day I do, the next week someone else does and we always enter 50 observations at a time (into an Excel sheet). So I can be pretty sure that I entered the cases from 101 to 150, and 301 to 350. We then read the data into R to work with it. How can I select only the cases I entered?
Now I know that I can do that by copying from the excel sheet, however, I wonder if it is doable in R?
I checked several documents about subsetting data with R, also tried things like
data<-data[101:150 & 301:350,]
but didn't work. I appreciate if someone would guide me to a more comprehensive guide answering this question.
The answer to the specific example you gave is
data[c(100:150,300:350),]
Can you be more specific about which cases you want? Is it the first 50 of each 100, or the first 50 of each 300, or ... ? To get the indices for the first n of each m cases you could use something like
c(outer(0:4,seq(1,100,by=10),"+"))
(here n=5, m=10); outer is a generalized outer product. An alternate (and possibly more intuitive) solution would use rep, e.g.
rep(0:4,10) + rep(seq(1,100,by=10),each=5)
Because R automatically recycles vectors where necessary you could actually shorten this to:
0:4 + rep(seq(1,100,by=10),each=5)
but I would recommend the slightly longer formulation as more understandable.