Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sakshikaul
Creator II
Creator II

Implement logic in qlik

Hi,

I have a following sample data(given below) in which I have to implement a logic. 

I want where cause damage tag=1 and also want to pick only one column (among material,outside labour,outside material and labour operation)  where three values are # and under one column there is some value then that column needs to be picked in pivot table 

like marked in red colour in below table. so how to write a calculated dimension

for eg:- 

  
 
 
 
 
 
Material
  
 
 
 
 
 
 
  
 
 
 
 
 
Outside Material
  
 
 
 
 
 
Labour Operation
  
 
 
 
 
 
Outside Labour
  
 
 
 
 
 
Cause of Damage Tag
 6R0937087ADZ0RCONTR.UNIT#1500000#1
 6R0937087ADZ0RCONTR.UNIT###1
#Not assigned#13621999#1
 6R0959802EFZ05WIND.MOT.#70591900#1
 6R0959802EFZ05WIND.MOT.###1
 6R0959801EDZ05WIND.MOT.#70591900#1
 6R0959801EDZ05WIND.MOT.###1
3 Replies
Brett_Bleess
Former Employee
Former Employee

I would venture it is going to be difficult for anyone to help you unless you attach a sample app with some data and your data model etc.  

The only other thing I can offer is the following:

https://community.qlik.com/t5/Qlik-Design-Blog/Calculated-Dimensions/ba-p/1472813

That may help you decide if calculated dimension is really what you want to do or if it would be better to use Set Analysis instead.

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

If you wish to search the Design Blog area further on your own, use the following URL for that:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

There are hundreds of mostly how-to posts in that area from our experts, so would think you should be able to find some things to help you with this one if I have not hit on the right ones.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
sakshikaul
Creator II
Creator II
Author

Hi,

Data model contains a single fact table and final UI Application and raw sample data is also attached is as follows(screenshot attached):-

Here I want to apply a logic that when (refer raw data) cause damage type=1 and among material,outside material,labour operation and outside labour only one value will be considered and displayed under the marked column (marked in black color)

The value which needs to be considered depends upon the following for eg if cause of damage type=1 and under material value is 123456 , outside material #, labour operation is # and outside labour is # then in this case material will be picked and will be shown under column (circled in   UI application (refer picture below)

simillarly eg-2 if cause of damage type=1 and under material value is # , outside material 12345, labour operation is # and outside labour is # then outside material column will be picked and value under outside material displayed in pivot chart (as shown below)

datamo.png

final UI application 

datamo.png

sakshikaul
Creator II
Creator II
Author

Hi,

I have created following expression. 

=if([Cause of Damage Tag]=1, if([Outside Labour]='#',if([Outside Material]='#',if([Labour Operation]='#',Material),
if([Outside Material]='#',if([Labour Operation]='#',if(Material='#',[Outside Labour]),
if([Outside Material]='#',if([Labour Operation]='#',if([Outside Labour]='#',[Labour Operation]),
if([Outside Labour]='#',if([Labour Operation]='#',if(Material='#',[Outside Material]))))))))))

Is it correct?