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

Help me in writing caliculated dimension?

Hi All,

I have below dimension

Dept_Id

1234A.2344

2345A.2567

1567A.1456

2758A.1234

1234F.2344

2345F.2567

1567F.1456

2758F.1234

Now i need to write the caliculated dimension based on the department id values in barchart.

If the deptid value contains A then it belongs to the ACCOUNTS department.

If the deptid value contains F then it belongs to the FINANCE department.

I need to display barchart with two bars (one is Accounts and other is Finance).

Note: I have already one expression which will show the total of values for particular department. So i need to divide department into two categories based on dimension.

So please help in writing caliculated dimension.

Thanks,

Durga

1 Solution

Accepted Solutions
b_garside
Partner - Specialist
Partner - Specialist

You can use the Pick WildMatch combo in your script and then use that new field in your chart..

Pick(WildMatch(Dept_Id,'*F*,'*A*'),'Finance','Accounting') as DeptGroup,

View solution in original post

7 Replies
b_garside
Partner - Specialist
Partner - Specialist

You can use the Pick WildMatch combo in your script and then use that new field in your chart..

Pick(WildMatch(Dept_Id,'*F*,'*A*'),'Finance','Accounting') as DeptGroup,

sunny_talwar

Or use this as your calculated dimension:

If(KeepChar(Dept_Id, 'A,F') = 'A', 'Accounting', 'Finance')

HTH

Best,

Sunny

b_garside
Partner - Specialist
Partner - Specialist

You can use either suggestion in chart or in script. Both will work.

sunny_talwar

PFA a sample application for you to review

Best,

Sunny

buzzy996
Master II
Master II

use this,

=If(WildMatch(Dept_Id,'*A*') ,'Accounts','Finance')

durgabhavani
Creator III
Creator III
Author

@Brain: It is simply working! Thanks much!

@Sunindia: it is also working! Thanks

But I am unable to open .qvw file as i have no access.

@Shiva: Useful

Thanks everyone!

b_garside
Partner - Specialist
Partner - Specialist

Glad it worked.