mondrian mdx在日期维度中过滤年份级别的集合(mondrian mdx filter a set on year level in a date dimension)
mdx新手。 我有一个具有日期维度的查询。 年份是整数,属于CalYear级别。 我正在使用蒙德里安(通过Pentaho)
我如何在2012年后展示多年? 数据年份为2012年,2013年,2014年的整数值。它是时间维度; 这个级别是一年。
如果我从这个查询开始:
SELECT [Measures].[SalesMonth] ON COLUMNS, {[YearMonth.CalYearMonth].CalYear.members} ON ROWS FROM [mt_report]
我得到了三行的结果。
我试试这个:
SELECT [Measures].[SalesMonth] ON COLUMNS, Filter({[YearMonth.CalYearMonth].CalYear.members}, [YearMonth.CalYearMonth].CalYear.CurrentMember.Value > 0) ON ROWS FROM [mt_report]
它返回所有数据(与第一个查询相同)
但
SELECT [Measures].[SalesMonth] ON COLUMNS, Filter({[YearMonth.CalYearMonth].CalYear.members}, [YearMonth.CalYearMonth].CalYear.CurrentMember.Value > 9999) ON ROWS FROM [mt_report]
但这也返回相同。
这有效......
Filter({[YearMonth.CalYearMonth].[CalYear].Members}, [YearMonth.CalYearMonth].[CalYear].CurrentMember.name > '2012')
mdx newbie. I have a query which has a date dimension. Years are integers and are in the level CalYear. I'm using Mondrian (via Pentaho)
How do I show years after 2012? The data years with integer values 2012, 2013, 2014. It is a Time dimension; this level is a Year.
If I start from this query:
SELECT [Measures].[SalesMonth] ON COLUMNS, {[YearMonth.CalYearMonth].CalYear.members} ON ROWS FROM [mt_report]
I get a result of three rows.
I try this:
SELECT [Measures].[SalesMonth] ON COLUMNS, Filter({[YearMonth.CalYearMonth].CalYear.members}, [YearMonth.CalYearMonth].CalYear.CurrentMember.Value > 0) ON ROWS FROM [mt_report]
and it returns all data (same as the first query)
but
SELECT [Measures].[SalesMonth] ON COLUMNS, Filter({[YearMonth.CalYearMonth].CalYear.members}, [YearMonth.CalYearMonth].CalYear.CurrentMember.Value > 9999) ON ROWS FROM [mt_report]
but this also returns the same.
This works ...
Filter({[YearMonth.CalYearMonth].[CalYear].Members}, [YearMonth.CalYearMonth].[CalYear].CurrentMember.name > '2012')
原文:
最满意答案
假设箭头是矢量,您可以将所有矢量数据插入到统一数组中**并使用gl_InstanceID在顶点着色器中查找它们并简单地将它们传递给gl_Position。
如果需要对箭头应用变换(通过查看数据:位置的平移,方向的旋转和长度的缩放),您将在一组顶点(基本箭头)上发出实例绘图语句),使用一个统一的矩阵数组进行变换,并在顶点着色器中以类似的方式查找这些矩阵。
**根据您拥有的实例数量,数据可能不适合统一数组。 所以你可以考虑使用Uniform块(它允许你存储比简单的统一变量更多的数据),如果这还不够,GL_TEXTURE_BUFFER就可以了。 不要让这个名字欺骗你,GL_TEXTURE_BUFFER可以保存任意数据,而不仅仅是纹理数据。
统一块由https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object支持
对于纹理缓冲区,请读出https://www.khronos.org/opengl/wiki/Buffer_Texture
Given that the arrow is a vector, you can just insert all your vector data into a uniform array** and use gl_InstanceID to look them up in your vertex shader and simply pass them over to gl_Position.
If you need to apply a transformation to the arrows (by looking at your data: translation for the location, rotation for the direction and scaling for the length), you would issue the instanced drawing statement on a single set of vertices (your base arrow), use a uniform array of matrices for the transformation and look those matrices up in a similar way in your vertex shader.
**Depending on how many instances you have though,the data may not fit into a uniform array. So you can look into using a Uniform block (which allows you to store more data than a simple uniform variable) and if that is also not enough, a GL_TEXTURE_BUFFER will do the trick. Don't let the name fool you, GL_TEXTURE_BUFFER can hold arbitrary data, not just texture data.
Uniform block is backed by https://www.khronos.org/opengl/wiki/Uniform_Buffer_Object
For texture buffer, read out https://www.khronos.org/opengl/wiki/Buffer_Texture
相关问答
更多-
首先使用最新的OpenCV版本,或使用Qt支持的版本。 确保您使用Qt支持安装OpenCV,如果您正在构建自己,那么使用Qt支持构建。 接下来转到此链接http://docs.opencv.org/modules/highgui/doc/qt_new_functions.html#setopengldrawcallback单个函数将允许您使用回调函数在图像的顶部绘制。 Firstly use latest OpenCV version, or use the version which comes with ...
-
将边界几何体渲染到模板缓冲区中 。 启用模板测试 将常规几何渲染为颜色缓冲区; 模板测试将防止边界几何体外的碎片写入颜色缓冲区。 Render bounding geometry into stencil buffer. Enable stencil test Render regular geometry into color buffer; the stencil test will prevent fragments outside the bounding geometry from writing ...
-
我解决了这个问题,所以如果有人遇到这个问题,问题就是blending功能。 删除线条 glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 解决了这个问题。 因为我可以没有他们,我很满意。 I solve the problem, so if anyone stumbles across this question, the problem was the blending feature. Removing the ...
-
从这里 : 实例化绘图在核心OpenGL ES 3.0 API和OpenGL ES 2.0中通过EXT_draw_instanced和EXT_instanced_arrays扩展提供。 您可以看到它可用于所有GPU,PowerVR SGX,Apple A7,A8。 (看起来@ Shammi没有回来......如果他们这样做,你可以改变接受的答案:) From here: Instanced drawing is available in the core OpenGL ES 3.0 API and in O ...
-
我建议你看看煤渣 。 试试Hello Cinder教程。 我认为你会发现它通过在DirectX或OpenGL之上提供一个抽象层来满足你的需求。 I would suggest that you take a look at cinder. Try out the Hello Cinder tutorial. I think you will find it supports your needs by providing an abstraction layer above DirectX or OpenG ...
-
我喜欢使用这样的渐变纹理来绘制线条: 这真是我纹理的阿尔法。 所以你有一个完全不透明的中心褪色到边缘完全透明。 然后,您可以使用带点的矩形绘制线条: (x1,y1,0,0),(x2,y1,1,0),(x1,y2,0,1),(x2,y2,1,1) 每个元组中的最后两个条目是u和v的纹理。 它看起来非常顺利。 您甚至可以将许多非常小的矩形串在一起,以制作曲线。 I like to use a gradated texture like this to draw lines: This is really the ...
-
如果您希望文本位于OpenGL查看区域之外,则可以将GLSurfaceView放置在布局中,并将文本放在其他控件中。 这是最简单的选择。 要在 GLSurfaceView中放置文本,可以将单个字符绘制为3D ojbects并将它们放置在适当的位置,或者使用所需的文本创建位图,并将其用作平面的纹理,并将其作为场景的一部分绘制。 If you want the text outside your OpenGL viewing area, you can place your GLSurfaceView with ...
-
最好只在片段着色器中做到这一点。 这样,您就可以使用普通的普通纹理,并且可以忘记必须渲染多于一个四边形的任何东西。 这是一个绘制网格的着色器,每个像素具有不同的前景/背景颜色。 它写在ShaderToy内部运行,所以你必须为你的程序调整它。 我在ShaderToy上进行了一个实时演示 (这与以下代码稍有不同,因此它可以在ShaderToy上运行)。 片段着色器 precision mediump float; // Texture coordinates, from 0 to 1 varying vec2 ...
-
我找到了解决方案,但我忘记发布了:)抱歉 package at.bartinger.opengl; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLSurfaceView; import android.opengl.GLU; import and ...
-
假设箭头是矢量,您可以将所有矢量数据插入到统一数组中**并使用gl_InstanceID在顶点着色器中查找它们并简单地将它们传递给gl_Position。 如果需要对箭头应用变换(通过查看数据:位置的平移,方向的旋转和长度的缩放),您将在一组顶点(基本箭头)上发出实例绘图语句),使用一个统一的矩阵数组进行变换,并在顶点着色器中以类似的方式查找这些矩阵。 **根据您拥有的实例数量,数据可能不适合统一数组。 所以你可以考虑使用Uniform块(它允许你存储比简单的统一变量更多的数据),如果这还不够,GL_TEX ...