Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Kohli
Creator II
Creator II

Create a table from existing table

Hi team, I have one table:

ID, Name, Sales

1, Hari, 2000

2,hari, 4009

3, Naresh, 5500

4, Naresh, 3000

I want output like these

Name, Sales

Hari, 4009

Naresh, 5500

What is the script for that?

5 Replies
Lisa_P
Employee
Employee

You can just create a table to show this using Name as dimension and Sum(Sales) as measure.

Qlik is case sensitive, so hari does not match Hari

Kohli
Creator II
Creator II
Author

If hari replace with Hari. Can you Please write the Script.

Max Value for Each name in a table.

Anil_Babu_Samineni

Try this?

Sample:

LOAD ID, Replace(Name,'hari','Hari') as Name, Sales Inline [

ID, Name, Sales

1, Hari, 2000

2,hari, 4009

3, Naresh, 5500

4, Naresh, 3000

];

Right Join(Sample)

LOAD Name, Max(Sales) as Sales Resident Sample Group By Name;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kruppas78
Contributor III
Contributor III

When there are some more wrong written names:

Table:
LOAD UPPER(LEFT(Name,1))&LOWER(Mid(Name,2)) AS Name,
MAX(Sales) AS Sales
RESIDENT RawTable
GROUP BY UPPER(LEFT(Name,1))&LOWER(Mid(Name,2))
;

nishanthi_8
Creator
Creator

If the names are not proper in the table and if you want  the dimension to be "Name", better go for captialize(Name) and use measure as max(Sales)

Required_Table:

Load

Capitalize(Name) as Name,

Max(Sales) as Sales

Resident Original_Table

Group by Capitalize(Name);