Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
kppiee
Contributor II
Contributor II

Calculated field use of Variable

How to use the variable in the calculated field.  I need the  Distinct count result based on ID and Data like table

IDNameDataDistinct Count(ID,Name)
1AKPI2
1AKPI2
1ARI3
1ARI3
1ARI3
2BSP1
2BTS1
Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Use Left Join 

Left Join (TableName)
LOAD ID,
     Name,
     Data,
     Count(ID) as Count
Resident TableName
Group By ID, Name, Data;

View solution in original post

13 Replies
sunny_talwar

If you only have ID, Name, and Data as dimension, Count(ID) should be enough... but if you have more dimensions, may be this Count(TOTAL <ID, Name, Data> ID)

kppiee
Contributor II
Contributor II
Author

It is the input table with three columns ID, Name and Data. I need to create a new column with  count of ID based on the same data

Sue_Macaluso
Community Manager
Community Manager

@kppiee Are you using QlikView or Qlik Sense? I would like to move this into the correct product forum. Thank you.

Sue Macaluso
kppiee
Contributor II
Contributor II
Author

QlikSense

sunny_talwar

You want to do that in the script?

kppiee
Contributor II
Contributor II
Author

Yes, if it possible from script 

sunny_talwar

Use Left Join 

Left Join (TableName)
LOAD ID,
     Name,
     Data,
     Count(ID) as Count
Resident TableName
Group By ID, Name, Data;
kppiee
Contributor II
Contributor II
Author

if I reload the data than the calculated field will remain or delete?

sunny_talwar

It will remain as long as the Left Join exists 🙂