Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create new calculated column (If, Else statement)

Hello community,

I'm new to QlikView and I'm hoping someone can point me in the right direction. I'm working with your typical HR data (EmpID, First Name, Last Name, etc) and I'm in need to start creating a dashboard where I can monitor gaps in my data, such as when an Active Employee has an Invalid or Null value for Manager ID, Job Grade and so on.

I understand that there are different ways to accomplish this through the script load as well as through a conditional variable, so I'm confused as to how to go about achieving this in the most efficient way. Perhaps by creating a new column in my dataset through a calculated If, Else statement?

Thank you in advance for any assistance you can provide!

-Andrew

4 Replies
vishsaggi
Champion III
Champion III

Can you explain a little what exactly you want to create and use this new column in?

You can create a flag in your load script like:

LOAD ...,

          IF(Len(Trim(ManagerID)) = 0 AND Len(Trim(JobGrade)) = 0, 0, 1) AS NullFlag

FROM yourdatasource;

Anonymous
Not applicable
Author

I hope i've understood your question, you can use a condition in the data load, indicating that if some field is empty, a new column specify that the data is incomplete;

Something like this

if( len(EmpID)=0 or len([First Name])=0 or len(Last Name)=0 ,'Incomplete','Complete') as Detail

len count the number of characters, if the data is empty then count 0

ahaahaaha
Partner - Master
Partner - Master

Hi Andrew,

Alternatively as variant, you can simply sort the field you need in the properties of the chart or list and all the empty values will be either at the beginning or at the end of the list, depending on the type of sorting.

Regards,

Andrey

Not applicable
Author

Thanks Vishwarath, my intention is to be able to create a chart where I can highlight all employee records without an assigned Level 1 Manager (same as direct supervisor) by Country and Region so I can easily point to locations where missing manager is a recurring problem. In your opinion, what would be the best way to approach this? Through a new 'AS' column in the load script?

Thanks so much again for your assistance!