Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Countdistinct is not working in query

Avatar

Avatar
Validate 10
Level 3
priyankah586599
Level 3

Likes

23 likes

Total Posts

89 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 3
priyankah586599
Level 3

Likes

23 likes

Total Posts

89 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
priyankah586599
Level 3

19-02-2018

Hi,

I have the following query

var clickQuery = xtk.queryDef.create(

      <queryDef schema={vars.targetSchema} operation="select" >

          <select >                                 

             

          <node expr="distinct(@journalDistributionID)" alias="@clicksJD_id"/>

           <node expr="date(@created)" alias="@clicksDate"/>

            <node expr="count(@type)" alias="@clicksCount"  /> 

            <node expr="count([@broadLog-id])" alias="@ID" />         

                                              

          </select>

            <where>

            <condition bool-operator="AND">

           <condition expr="@type='1'" />

           <condition expr="@type!='3'" />

           </condition>

            </where>

          <orderBy/>                  

          <groupBy>

        <node expr="@journalDistributionID" />

          <node expr="date(@created)" />

        

          <node expr="@type"   />

         

         

         

          </groupBy>          

      </queryDef>    );

Unfortunately Countdistinct is not working for me. Can you pls help?

Regards,

Priyanka

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
Employee
Adhiyan
Employee

Likes

239 likes

Total Posts

342 posts

Correct Reply

124 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile

Avatar
Boost 50
Employee
Adhiyan
Employee

Likes

239 likes

Total Posts

342 posts

Correct Reply

124 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 25
Boost 100
View profile
Adhiyan
Employee

16-12-2019

Hi Priyanka,

 

CountDistinct as a function should work , probably the syntax for picking up broadLog-id is wrong.

If the target schema is linked to the broadLogRcp schema the syntax would be [targer/@broadlog-id] .

 

regards,

adhiyan

Answers (2)

Answers (2)

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct Reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

13-03-2018

Hi,

I don't know what can cause this. Were you able to resolve the issue since?

Florent

Avatar

Avatar
Validate 10
Level 3
priyankah586599
Level 3

Likes

23 likes

Total Posts

89 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 3
priyankah586599
Level 3

Likes

23 likes

Total Posts

89 posts

Correct Reply

4 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
priyankah586599
Level 3

19-02-2018

Sorry I'm reposting my query

var clickQuery = xtk.queryDef.create(

      <queryDef schema={vars.targetSchema} operation="select" >

          <select >                                 

             

          <node expr="distinct(@journalDistributionID)" alias="@clicksJD_id"/>

           <node expr="date(@created)" alias="@clicksDate"/>

            <node expr="count(@type)" alias="@clicksCount"  /> 

            <node expr="Countdistinct([@broadLog-id])" alias="@ID" />         

                                              

          </select>

            <where>

            <condition bool-operator="AND">

           <condition expr="@type='1'" />

           <condition expr="@type!='3'" />

           </condition>

            </where>

          <orderBy/>                  

          <groupBy>

        <node expr="@journalDistributionID" />

          <node expr="date(@created)" />

        

          <node expr="@type"   />

         

         

         

          </groupBy>          

      </queryDef>    );