logo
down
shadow

SSRS Displaying Comma Delimited or Distinct Values in Single Column


SSRS Displaying Comma Delimited or Distinct Values in Single Column

By : Kyle Chiu
Date : November 22 2020, 02:59 PM
seems to work fine Using this dataset to test I recreated your scenario.
code :


Share : facebook icon twitter icon
Counting distinct items and parsing comma-delimited values using XSLT

Counting distinct items and parsing comma-delimited values using XSLT


By : somdip
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Suppose I have XML like this: , Another way without extension:
code :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 

    <xsl:variable name="all-value" select="/*/*/*/*/@value"/> 

    <xsl:template match="/"> 
        <xsl:variable name="count"> 
            <xsl:apply-templates select="$all-value"/> 
        </xsl:variable> 
        <xsl:value-of select="string-length($count)"/> 
    </xsl:template>  

    <xsl:template match="@value" name="value">
        <xsl:param name="meta" select="translate(.,'[] ','')"/>
        <xsl:choose>
            <xsl:when test="contains($meta,',')">
                <xsl:call-template name="value">
                    <xsl:with-param name="meta" select="substring-before($meta,',')"/>
                </xsl:call-template>
                <xsl:call-template name="value">
                    <xsl:with-param name="meta" select="substring-after($meta,',')"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:if test="count(.|$all-value[contains(translate(.,'[] ','&#xA;&#xA;&#xA;'),
                                                          concat('&#xA;',$meta,'&#xA;'))][1])=1">
                    <xsl:value-of select="1"/> 
                </xsl:if> 
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template> 

</xsl:stylesheet> 
Get distinct values from a comma-delimited column in a MySQL table?

Get distinct values from a comma-delimited column in a MySQL table?


By : user2788939
Date : March 29 2020, 07:55 AM
this one helps. The way I chose was to run the select mysql command outside of the mysql shell and pipe the results into tr and sort --uniq
code :
mysql my_db [-p -u -h] -se "select my_column from my_table;" | tr ',' '\n' | sort -u
mysql select distinct rows into a comma delimited list column

mysql select distinct rows into a comma delimited list column


By : user3837837
Date : March 29 2020, 07:55 AM
should help you out Use GROUP_CONCAT() for this, with a GROUP BY covering the other three columns:
code :
SELECT 
  name,   -- Microsoft
  other,  -- GGG
  other2, -- 1
  GROUP_CONCAT(id) AS ids
FROM tbl
GROUP BY name, other, other2
Comma-delimited Distinct Values Of A Table Or Result-set

Comma-delimited Distinct Values Of A Table Or Result-set


By : Almas Hossain
Date : March 29 2020, 07:55 AM
will be helpful for those in need So I have specification tables that relate to products that vary by product type. I need a stored procedure that will return a single-row of unique comma-delimited values in each of the columns (used for site navigation code) in a spec table (or a resultset of said spec table). , Assuming I've understood:
code :
declare @productTypes table (Id int, Name nvarchar(32))
declare @products table (Id bigint not null identity(1,1), ProductType int, ProductName nvarchar(32))

insert @productTypes (Id, Name)
select 1, 'Food'
union
select 2, 'Drink'

insert @products (ProductType, ProductName)
select 1, 'Chips'
union
select 1, 'Fish'
union
select 2, 'Guinness'
union
select 2, 'Water'
union
select 2, 'Pan Galactic Gargle Blaster'

select pt.Name 
, STUFF
(
    (
        Select ',' + a.ProductName
        from @products a
        where a.ProductType = pt.Id
        FOR XML PATH('')),1,1,''
) ProductsOfType
from @productTypes pt
Name    ProductsOfType
Food    Chips,Fish
Drink   Guinness,Pan Galactic Gargle Blaster,Water
mysql select distinct comma delimited values

mysql select distinct comma delimited values


By : Michael Nunez
Date : March 29 2020, 07:55 AM
Hope that helps Split it before adding it all up with DISTINCT.Of course,better is to normalize your data(no more than 1 value in a column)
code :
SELECT
  GROUP_CONCAT( DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(keywords, ',', n.digit+1), ',', -1)) keyword
FROM
  t
  INNER JOIN
  (SELECT 0 digit UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3  UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6) n
  ON LENGTH(REPLACE(keywords, ',' , '')) <= LENGTH(keywords)-n.digit
WHERE cid=28
shadow
Privacy Policy - Terms - Contact Us © animezone.co