Could you please let me know, why I am seeing different counts in bar chart and table?
In bar chart 2 fields are blank for Business Unit but it is showing 4 in bar chart.
Also bar chart is showing 2 counts for "f" Reporting Unit although it is only 1 in table?
I am attaching app too, which has script and visualization too.
I highly appreciate your help ❤️
Here's the code.
Cost:
LOAD
User_Name,
First_Name,
Last_Name,
BU,
RU,
Std_License,
"Cost Point"
FROM [lib://QlikHelp/QlikHelp_2017_V1.xlsx]
(ooxml, embedded labels, table is Sheet1);
M: //Code for User_Name with Maximum "Cost Point"
inner keep load
"User_Name" as ID,
LastValue(BU) as [Business Unit], //fetch last value from a record having multiple values
LastValue(RU) as [Reporting Unit],
LastValue(Std_License) as [License Type],
LastValue(First_Name) as FName,
LastValue(Last_Name) as LName,
max("Cost Point") as MaxCostPoint
resident Cost
Group By "User_Name"
Order By "User_Name","Cost Point" ; //sort in ascending order
Repeated_User: //Code for eliminating repeated users
Load Distinct
ID,
FName,
MaxCostPoint,
[License Type],
LName,
Left(FName,5)&' '&Left(LName,5) as Name, //fetch first 5 character from First and Last Name
[Reporting Unit],
[Business Unit]
Resident M
Order By MaxCostPoint desc;
Z1:
Load *,
if("Name" = Previous("Name"),'Repeated', 'Unique') as "Repeated User" //search if similar user exist, if exist,
//it falls in repeated user category, Unique oterwise
Resident Repeated_User
//Where "Name" <> Previous("Name")
Order By Name;
Drop Table Repeated_User;