java中的values函数_巧用valueat函数(快逸免费版)

在制作报表时,经常会遇到将数据库里一列数据按照条件取值后,分为多列显示的需求,例如:数据库中有一列名为type的数据,在报表中,第一列选择type为1的数据,第二列选择type为2的数据。由于受到扩展格的影响,总是实现不了这样的需求。本文简单简单介绍一下如何用valueat函数实现按条件取值分多列显示数据的需求。

第一步:制作报表,如图所示:

155.jpg

预览效果:

156.jpg

如图所示,由于B2的默认左主格是A2,所以B2随A2扩展,里面没有数据。

第二步:修改报表,如图所示:

157.jpg

如图所示:首先在B2和C2用count函数计算出指定条件后有多少条数据,然后在A3单元格中用max函数获取一个最大值,然后用to函数从0扩展出展示数据所需要的单元格数量,最后用valueat函数根据指定位置返回数组或者集合表达式中的某一个元素。

Valueat函数的用法如下:

语法:

valueat(arrayexp,suffixExp)

参数说明:

arrayexp    数组或者集合表达式

suffixExp    整数,用于指定返回集合中的第几个元素,以0开始计数

返回值:

集合中的一个元素,数据类型由集合中的元素类型决定

示例:

例1:valueat(to(5,8),2)        返回值为:7

例2:valueat({“a”,”b”,”c”},0)    返回值为:”a”

B3单元格里的表达式:valueat(ds1.Select(TYPE,,TYPE==”9011″),A3)

C3单元格的表达式:valueat(ds1.Select(TYPE,,TYPE==”9011″),A3)

预览效果:

158.jpg

这样,就可以实现将数据库里的一列数据按条件分成多列显示了。同理,还可以添加C列,D列等。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/440785.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java设计流程执行器_Java进阶面试精选系列:SpringMVC+SpringBoot+Hibernate+Mybatis+设计模式...

小编精心收集:为金三银四准备,以下面试题先过一遍,为即将到了的面试做好准备,也过一遍基础知识点。一、Spring/Spring MVC1.为什么要使用 spring?2.解释一下什么是 aop?3.解释一下什么是 ioc?3.…

【牛客 - 370E】Rinne Loves Gift(Bellman_Ford判负环,二分,分数规划)

题干: 链接:https://ac.nowcoder.com/acm/contest/370/E 来源:牛客网 Rinne 喜欢礼物,也喜欢送礼物 圣诞节快到了,Rinne 要去给给住在城市里的人送礼物 城市的交通可以抽象成一个 n 个点 m 条边的有向图 每条边上有…

【POJ - 2976】【ZOJ - 3068】【SCU - 2992】Dropping tests (01分数规划)

题干: In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be . Given your test scores and a positive integer k, determine how high you can make your cumulative aver…

重写过的url 怎么获取当前页面url java_网站URL重写(Java UrlRewrite 的使用)

现在大部分的网站和商城都会使用到URL重写,接触到这个,也是因为正在做的电子商务商城。URL重写,是将原有的URL采用另一种规则来显示,使得用户方便访问同时也屏蔽一些信息。在此说下它的好处,在开发过程中,经…

Java行业情景分析_Java 设计模式情景分析——单例模式

单例模式可以说是应用最广的模式之一,在应用单例模式时,单例对象的类必须保证只有一个实例存在,而且可以自行实例化并向整个系统提供这个实例。一般在不能自由构造对象的情况下,就会使用单例设计模式,例如创建一个对象…

php实现播放直播_PHP直播技术分享(一:实现直播)

推流服务器采用的是自搭的推流服务器 , 自己玩玩 做外包项目还是去搞七牛云/阿里这样的服务器吧,开始bb-----1:技术栈image.jpeg2:开发中业务(1)主播申请时创建个秘钥 , 这个秘钥随时字符串即可到时候根据字符串找到拉流的直播位置存数据库包括推流地址image.png3:配置nginx-rt…

php获取location,php获取header[‘location’]信息常见问题

15/01/31本文关键字: 302, header, location//初始化url信息$host “#8221;;$url$host.”l/rzTf7ap2viw/&iid222004556&resourceId0_04_05_99/v.swf”;//按照字段获取header响应信息$headers get_headers($url, TRUE);//获取这个土豆的302跳转地址$u302 $headers[“Lo…

php对联广告,html左右对联代码 cms网站对联广告html代码

实现网页左右两侧居中的对联广告代码你只记得自己有好多朋友却从没想过小编只有你一人。无标题文档 #left{ width:200px;height:450px; position:absolute; left:0px; background:red; border:1px #000 solid} #right{width:200px;height:450px; position:absolute; right:0px;…

php 分页 url重写 分页问题,解决千古难题,wordpress分页URL问题,wordpress给分页加链接...

原本的wordpress文章如果分页会成如下的结构:http://www.xyqzmt.cn/1.html/2通常固定链接都是这样的结构,设为/%postname%.html或者/%post_id%.html 以前我一直无法解决如上的问题,最后放弃挣扎,如果遇到很长的文章全都放在一个页…

【牛客 - 181F】子序列(容斥,组合数,费马小定理)

题干: 题目描述 给出一个长度为n的序列,你需要计算出所有长度为k的子序列中,除最大最小数之外所有数的乘积相乘的结果 输入描述: 第一行一个整数T,表示数据组数。 对于每组数据,第一行两个整数N,k&#…

【CodeForces - 485C】Bits (二进制相关,数学,贪心)

题干: Lets denote as the number of bits set (1 bits) in the binary representation of the non-negative integer x. You are given multiple queries consisting of pairs of integers l and r. For each query, find the x, such that l ≤ x ≤ r, an…

php工程导致系统蓝屏,经常蓝屏是什么原因

经常蓝屏的原因:1、错误安装或更新显卡驱动后导致电脑蓝屏;2、超频过度是导致蓝屏;3、安装的软件存在不兼容;4、电脑内部硬件温度过高;5、内存条接触不良或内存损坏。错误更新显卡驱动错误安装或更新显卡驱动后导致电脑…

【CodeForces - 485A】Factory (水题,抽屉原理,tricks)

题干: One industrial factory is reforming working plan. The director suggested to set a mythical detail production norm. If at the beginning of the day there were x details in the factory storage, then by the end of the day the factory has to p…

matlab调用哈希表,ros与matlab联动使用

ros与matlab联动使用联动使用教程1 ubuntu18.04或16.04下安装matlab R2017b参考链接2 ubuntu下基于matlab启动rosmatlab中常用命令如下:查看robotics system toolbox工具箱是否安装成功help robotics.rosrosinit ——表示启动ROS,相当于roscorerosshutdo…

【CodeForces - 1020A】New Building for SIS(模拟)

题干: You are looking at the floor plan of the Summer Informatics Schools new building. You were tasked with SIS logistics, so you really care about travel time between different locations: it is important to know how long it would take to get …

【CodeForces - 1020B】Badge(模拟,图,环)

题干: In Summer Informatics School, if a student doesnt behave well, teachers make a hole in his badge. And today one of the teachers caught a group of nn students doing yet another trick. Lets assume that all these students are numbered from …

【Hihocoder - 1723】子树统计(线性基合并)

题干: 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一棵N个节点的有根树,树上每个节点有一个非负整数权重Wi。定义节点集合S{i1, i2, ……, ir}的总权重为:(⊕是异或运算) 每次询问一棵子树内所有可能出现的总权重数量&a…

【CodeForces - 485D】Maximum Value (枚举,用数组离散化,数学,取模运算,因子,筛法)

题干: You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided by aj), where 1 ≤ i, j ≤ n and ai ≥ aj. Input The first line contains integer n — the length of the seq…

【牛客 - 371牛客OI周赛7-提高组A】小睿睿的等式(dp,暴力 )

题干: 链接:https://ac.nowcoder.com/acm/contest/371/A 来源:牛客网 小睿睿在游戏开始时有n根火柴棒,他想知道能摆成形如“ABn”的等式且使用的火柴棒数也恰好等于n/k的等式有多少种(BAn与ABn看作一种) 注: “”与…

oracle用户新增数据文件,[数据库]20200722_Oracle添加表空间、用户,用户授权

[数据库]20200722_Oracle添加表空间、用户,用户授权0 2020-07-25 17:00:30--创建表空间CREATE TABLESPACE aifu --表空间名 aifu LOGGING DATAFILE D:\dev_config\OracleTableSpaces\aifu.DBF SIZE 5M --数据文件路径 D:\dev_config\OracleTableSpaces AUTOEXTEND O…