星型模式中我的时间维度表的属性(Attributes of my Time dimension table in star schema)
我正在使用星型模式建模构建DW。 我将它用于pentaho的BI项目。 我当然会有时间维度表。 我将用不同的粒度(日,周,月,或许其他)分析我的事实表
我应该在维度表中为每个粒度添加一个属性(所以我有一天属性,一个月属性,一年属性......)或者我应该只写日期然后用这个日期计算所有内容(得到日期的月份,日期的年份......)?
非常感谢你的帮助
I'm building a DW with a star schema modeling. I'll use it for a BI project with pentaho. I'll have of course a time dimension table. I'll analyze my fact table with differents granularity (day, week, month year, perhaps other)
Should I put one attribute for each of those granularity in my dimension table (so I have one day attribute, one month attribute, one year attribute ...) or should I just write the date and then calculate everything with this date (get the month of the date, the year of the date ...)?
thks a lot for your help
原文:https://stackoverflow.com/questions/15202389
最满意答案
in >> width0 >> height0;
,EOF标志设置为on,这将阻止任何进一步的使用。通过
in.str(line)
将流与新数据相关in.str(line)
不会重置标志,您必须通过in.clear()
。After
in >> width0 >> height0;
, the EOF flag is set onin
, which will prevent any further usage.Associating the stream with new data via
in.str(line)
doesn't reset the flags, you will have to do that yourself viain.clear()
.
相关问答
更多-
有时使用stringstream在字符串和其他数值类型之间进行转换是非常方便的。 stringstream的用法类似于iostream的用法,因此不是学习的负担。 Stringstreams可用于读取字符串并将数据写入字符串。 它主要使用字符串缓冲区,但没有真正的I / O通道。 stringstream类的基本成员函数是 str() ,它以字符串类型返回其缓冲区的内容。 str(string) ,将缓冲区的内容设置为string参数。 这是一个如何使用字符串流的例子。 ostringstream os; ...
-
我想出了两个HACK解决方案,但它们应该可以工作。 第一个不使用范围解析运算符,更安全。 第二个使用noop int变量来伪造范围。 #define logging_printStream(token) { std::stringstream o; o << token; logging::print(o.str().c_str()); } namespace logging { int noop; } #define printStream(token) noop = 0; { std::strings ...
-
当应用于字符串时,istream >>运算符会丢弃最终的初始空格并读取第一个“空格”。 它适用于任何类型(包括int)。 它适用于您的代码,因为在','“int reader”失败,并假设以下是其他内容。 读取逗号分隔字符串的最简单方法是使用std::getline函数,给出一个','作为分隔符。 在您的情况下,您的模板功能 template
std::istream &operator>>(std::istream &is, Array &t) { ...... } 仍然 ... -
您可以测试>>的返回值。 while (ss >> t) { lis.push_back(t); } 它没有指定循环阅读。 这是ss << s追加"1 2 3 4"到流的末尾。 在第一个循环之前: "" 在第一个ss << s : "1 2 3 4" 在第一个ss >> t : " 2 3 4" 在第二个ss << s : " 2 3 41 2 3 4" 然后很清楚为什么你得到1 2 3 41 2 3 41 2 3 41如果s没有尾随空格。 You can test the return ...
-
我认为你需要的是一个String数组。 String[] strArray = new String[st.countTokens()]; // Create an array with no. of tokens as the size int counter = 0; // Counter variable to be used as the arrays index. while (st.hasMoreElements()){ //instead of printing the element ...
-
重用字符串流来连续解析来自多个字符串的值(reusing a stringstream to parse values from multiple strings in succession)[2022-02-27]
in >> width0 >> height0; ,EOF标志设置为on,这将阻止任何进一步的使用。 通过in.str(line)将流与新数据相关in.str(line)不会重置标志,您必须通过in.clear() 。 After in >> width0 >> height0;, the EOF flag is set on in, which will prevent any further usage. Associating the stream with new data via in.str(l ... -
如何多次正确使用stringstream类[重复](how to correctly use stringstream class multiple times [duplicate])[2022-05-20]
call ss.clear() stringstream ss; string s1="stack",s2="overflow"; string s3,s4; ss<>s3; ss.str(""); cout< >s4; cout< 如果你知道string_with_data中数据的类型,那么它会更简单:只需读取该类型的一个值,然后在将其推入向量之前将其强制转换为所需类型: templatevector & ReadValues(std::string& string_with_data) { std::stringstream ss(string_with_data); std::vector values; float val; // use original type not ... 在循环中使用stringstream从几个字符串中提取数字(Using stringstream inside a loop to extract a number from few strings)[2022-07-27]
问题:只有第一个输入的输入数存储在“金额”中。 下一个输入的数量不会存储在“金额”中(金额内部始终具有相同的数字)。 也许,我不知道有什么关于stringstreams ... 是。 使用一次后,您忘记重置 std::stringstream 。 为此,您需要使用std::stringstream::str将基础序列 (字符串流的内容)设置为空字符串,并使用clear将失败 (如果有)和eof标志设置为空字符串。 这意味着,你的for循环结束你需要这个: SEE LIVE int main() { . ...对和stringstream(Pairs and stringstream)[2021-10-02]
你的operator>>接收一个std::stringstream ,在那一刻包含一个像"time:5"这样的字符串。 运算符需要通过将其拆分为两个标记来解析该字符串,然后将第一个标记转换为F ,将第二个标记转换为S 一种方法是使用std::getline和自定义分隔符。 最终会得到两个std::string标记。 例如,可以使用两个内部std::istringstream来转换std::istringstream 。 您可以尝试以下代码: templatestd:: ... 相关文章
更多- USER AND SCHEMA
- The Log: What every software engineer should know about real-time data's unifying abstraction
- user and schema(转)
- solr schema
- SOLR 中 Schema.xml 的filedType 的一些属性的理解
- table-Oceanus配置说明
- 求教一个 table的css
- 关于 solr schema.xml 的配置说明
- Real-Time Rendering 笔记 --- 1-4章
- 关于solr schema.xml 和solrconfig.xml的解释
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。