powerbi-desktop - 如何在powerbi中仅提取字母数字值
问题描述
数据 ABC123 JKL685 UJKLPN 655789
输出:ABC123 和 JKL685 显示为真,其余为假。如何实现这个场景。
解决方案
这是我使用 Power Query 的建议:
let
numbers = List.Transform(List.Numbers(0,10), each Text.From(_) ),
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyNjQyVorViVby8vYxszAFM0OB7AA/MNPM1NTcwlIpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Data = _t]),
#"Filtered numerical" = Table.SelectRows(Source, each try if Value.Type(Number.From([Data])) = type number then false else true otherwise true),
#"Filtered alphabetical" = Table.SelectRows(#"Filtered numerical" ,
(FindStrings) =>
List.AnyTrue(List.Transform(numbers, each Text.Contains((FindStrings[Data]),_ ))))
in
#"Filtered alphabetical"
它首先通过尝试转换为数字并仅保留无法转换的行来过滤掉完整的数字条目。然后它过滤只包含字母的行。它可能不是非常有效,但适用于示例数据。
推荐阅读
- php - 尝试读取上传的文件时出现错误“警告:文件(...):无法打开流:...中没有此类文件或目录”
- java - Java Reactor StepVerifier.withVirtualTime 循环:反复检查“expectNoEvent()”、“expectNext()”和“thenAwait()”
- python - 遇到 row > y 时读取 csv 文件并播放 cue
- sass - vue-cli 和奇怪的策略什么的。如何禁用内容安全策略以及它发生的原因
- javascript - Firebase 和 JavaScript - 如何更新具有特定 ID 值的对象?
- spotify - 如何与 Spotify 服务器同步时钟?
- bitbucket - Bitbucket git lfs 推拉失败
- node.js - 通过批处理脚本获取节点版本
- javascript - 如何从 blob url 读取数据?
- c# - 获取正文邮件包