SAS日期格式(SAS date formatting)
我有一个带变量的数据集,开始日期,它使用字符格式获取许多不同的值。
我使用开始日期列中的值拆分数据集,因为我想将日期变量转换为两个具有两个不同日期值的新列:
if length(Startvalue) = 6 then output a6; else if length(Startvalue) = 8 then output a8 ; else if length(Startvalue) = 1 then output a1; else output a_other;
一个值写成这样:090209(DDMMYY)
我想将变量格式化为date9。 格式和DDMMYYD10。 格式如下:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.;
我在数据步骤中使用此方法:
FORMAT Startdato2 date9.; format startdato3 DDMMYYD10.; Startdato2 = INPUT(PUT(Startdato,6.),DDMMYY6.); Startdato3 = INPUT(PUT(Startdato,6.),DDMMYY6.);
另一个值是这样写的:15-08-17(DD-MM-YY)我也想要这个值的两种格式,如下所示:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.;
但在这里我不能使用上面的表达副本:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.; Startvalue2 = INPUT(PUT(Startvalue,8.),DDMMYYDw.); Startvalue3= INPUT(PUT(Startvalue,8.),DDMMYYDw.);
你知道为什么吗? 以及如何将价值转化为日期9。 格式和DDMMYYD10格式?
亲切的问候
玛丽亚
I have a dataset with a variable, start date, which takes a lot of different values using a character format.
I have split the dataset up using the values in the start date column, because I want to transform the date variable into two new columns with two different date values:
if length(Startvalue) = 6 then output a6; else if length(Startvalue) = 8 then output a8 ; else if length(Startvalue) = 1 then output a1; else output a_other;
One value is written like this: 090209 (DDMMYY)
I want to format the variable into both a date9. format and a DDMMYYD10. format like this:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.;
I got it to work with this approach in a data step:
FORMAT Startdato2 date9.; format startdato3 DDMMYYD10.; Startdato2 = INPUT(PUT(Startdato,6.),DDMMYY6.); Startdato3 = INPUT(PUT(Startdato,6.),DDMMYY6.);
Another value is written like this: 15-08-17 (DD-MM-YY) I also want the two formats on this value, like this:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.;
BUT here I cannot use a copy of my expression from above:
FORMAT Startvalue2 date9.; format Startvalue3 DDMMYYD10.; Startvalue2 = INPUT(PUT(Startvalue,8.),DDMMYYDw.); Startvalue3= INPUT(PUT(Startvalue,8.),DDMMYYDw.);
Do you know why? And how I can get the value transformed into a date9. format and a DDMMYYD10 format?
Kind regards
Maria
原文:https://stackoverflow.com/questions/43279312
最满意答案
感谢您没有回答我的问题,所以我通过使用图表控件底部的datalist来完成自己的任务。 我在表中添加了一个datalist控件,其中存在图表控件,并将所需的数据表绑定到datalist,并在运行时将数据绑定到datalist控件。 为了显示datalist中的数据,我使用了datalist的RepearDirection属性并将其设置为“Horizontal”。 最后,我的报告显示为我所需的格式。 对于图表区域,我为相同的X和Y点添加了两种类型的系列,以便按照我的要求显示折线图,一个系列是气泡而另一个是线。
所以,最后我的图表显示如下。
Thank you for not responding to my question, so any how I have done it my self by using datalist at the bottom of the chart control. I added one datalist control to the table in which chart control is present and binded the required data table to the datalist and also binded images to the datalist control at runtime from a datatable. Inorder to display the data present in datalist, i used RepearDirection property of the datalist and set it to "Horizontal". Finally my report displayed like my required format. And for the chart area, i added two types of series for the same X and Y points inorder to display Line chart as I required, one series is bubble and another is line.
So, finally my graph displayed as below.
相关问答
更多-
你可以尝试下面的版本,我已经添加了多个系列和图例到同一个图表对象(我已经为此系列名称获取动态)并保存它: Function drawPie ($chart,$hash,$ChartT){ $ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea $Series = New-Object -TypeName System.Windows.Forms.DataVisualization. ...
-
尝试ElementPosition一个ElementPosition对象,如下所示: chart.Legends["Legend1"].Position.Auto = false; chart.Legends["Legend1"].Position = new ElementPosition(30, 5, 100, 20); 注意: ElementPosition的构造ElementPosition需要0或4个参数(x,y,宽度,高度)。 Try newing up an ElementPosition ...
-
6个jQuery Chart插件为您的应用程序 海军报 Flot是一个用于jQuery的纯Javascript绘图库。 它可以在即时客户端生成任意数据集的图形图。 jQuery Sparklines 这个jQuery插件使用HTML中内联提供的数据或通过javascript直接在浏览器中生成迷你图(小内联图表)。 jQuery Google Charts 1.0 jQuery Chart插件版本0.1 jQchart TufteGraph 6 jQuery Chart Plugins For Your Ap ...
-
在.net用户控件(asp:向导)中返回asp.net图表(Return asp.net chart within a .net user control (asp:wizard))[2021-10-24]
如果您要返回实际的图表控件 - 您需要将其添加到表单上的控件集合中。 例如,使LiteralGraph而不是Literal - 一个Panel然后你可以做: LiteralGraph.Controls.Add(GE.GetChart(getSetGraphData, t13)); If you're returning actual chart control - you need to add it to a control collection on the form. For example, ma ... -
当您配置图表控件时,您可以设置信息保存的位置,然后只需设置Robots.txt文件即可禁止从该文件夹索引内容。 有关Robots.txt禁止图像索引的更多信息可以在此处找到。 When you configure the chart control you can setup the location that information is saved to, then simply setup a Robots.txt file to disallow indexing of content from t ...
-
您需要确保valuesA1 ArrayList的结果与xValues数组中的值相同。 在内部,它循环遍历两个集合,期望它们具有相同的数字,并且由于valuesA1 ArrayList中的成员较少而导致错误。 You need to make sure that your valuesA1 ArrayList ends up with the same number of values as you have in your xValues array. Internally it's looping thr ...
-
我找到了答案。 我需要手动将以下内容添加到我的web.config中。
asp.net图表 - 显示数字(asp.net charts - show numbers)[2024-02-27]
做这个: chart.Series["Default"].Label = "#PERCENT{P2}"; chart.Series["Default"].LegendText = "#VALX"; 更多信息可在此处获得: 如何:在饼图上显示百分比值 Do this: chart.Series["Default"].Label = "#PERCENT{P2}"; chart.Series["Default"].LegendText = "#VALX"; More info is available her ...在asp.net图表控件中添加表格值和图例(Adding tabular values along with the legends in asp.net chart controls)[2023-09-02]
感谢您没有回答我的问题,所以我通过使用图表控件底部的datalist来完成自己的任务。 我在表中添加了一个datalist控件,其中存在图表控件,并将所需的数据表绑定到datalist,并在运行时将数据绑定到datalist控件。 为了显示datalist中的数据,我使用了datalist的RepearDirection属性并将其设置为“Horizontal”。 最后,我的报告显示为我所需的格式。 对于图表区域,我为相同的X和Y点添加了两种类型的系列,以便按照我的要求显示折线图,一个系列是气泡而另一个是线。 ...http://www.aspsnippets.com/Articles/Create-ASPNet-Chart-Control-from-Database-using-C-and-VBNet-Example.aspx希望它能帮助您获得一些理解。 http://www.aspsnippets.com/Articles/Create-ASPNet-Chart-Control-from-Database-using-C-and-VBNet-Example.aspx Hope it will help you to ...相关文章
更多- 用SimpleDateFormat把字符串转换成Date的时候报NumberFormatException
- 在java.util.Date中,如何比较两个Date的大小,精确到分
- display控件格式化时间日期的问题?
- Java日期时间
- XStream的日期转换XStreamDateConverter
- flex 日期转换 灵异事件
- java 存取oracle数据库日期数据
- javascript日期相加函数
- Extjs Datefield的格式问题
- 日期和时间的国际化
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)