Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rsaiq
Creator
Creator

Create calculated dimension in qliksense

HI Experts,

I have a reuirement in qliksense as need  2 field to merge into one. I am explaining in details as below:

I have 2 existing fields

20230827_224014.jpg

Now as per the requirement We need to merge fields with some calculations like below

20230827_224455.jpg

20230827_224605.jpg

So When i am clicking on BBB or clicking on Individual then it is working fine. But when clicking on BBB Income or BBB Cover or BBB Asset it is also selecting BBB

 

Could you please tell me how to ignore BBB when selecting BBB Income or BBB Cover or BBB Asset 

 

Thanks in advance.

 

1 Solution

Accepted Solutions
ajaykakkar93
Specialist III
Specialist III

hi,

I understand your requirements. You can create a link table to achieve this. The code below will be helpful.

ajaykakkar93_0-1693388808308.pngajaykakkar93_1-1693388826456.png

 

 

data:
load 
[BBB/Individual]&[Net/Network] as %key,
[BBB/Individual] as [BBB_Individual] ,
[Net/Network] as [Net_Network] ;
Load * Inline [
BBB/Individual,Net/Network
BBB,Income
Individual,Income
Individual,Cover
BBB,Cover
BBB,Asset
];
 
 
linkTable:
load %key,
filter
;
load 
[BBB/Individual]&[Net/Network] as %key,
[BBB/Individual] as [BBB_Individual] ,
[Net/Network] as [Net_Network],
filter;
Load * Inline [
BBB/Individual,Net/Network,filter
BBB,Income,BBB Income
Individual,Income,Individual Income
Individual,Cover,Individual Cover
BBB,Cover,BBB Cover
BBB,Asset,BBB Asset
BBB,Income,BBB
BBB,Cover,BBB
BBB,Asset,BBB
];
 
 
exit Script;

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

View solution in original post

11 Replies
ajaykakkar93
Specialist III
Specialist III

Hi,

Frontend you can use the below code:
=if(
WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Income') ,'BBB Income',
if(
WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Asset') ,'BBB Asset',
if(
WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Cover') ,'BBB Cover',
if(WildMatch( [BBB_Individual],'Individual') and not(WildMatch( [BBB_Individual],'*income*','*asset*','*cover*')) ,'Individual',
if(WildMatch( [BBB_Individual],'BBB') and not(WildMatch( [BBB_Individual],'*income*','*asset*','*cover*')) ,'BBB',
'N/A'
))
)
)
)


Backend you can use the below code


data:
load *,
if(
WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Income') ,'BBB Income',
    if(
        WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Asset') ,'BBB Asset',
        if(
            WildMatch( [BBB_Individual],'BBB') and WildMatch( [Net_Network],'Cover') ,'BBB Cover',
if(WildMatch( [BBB_Individual],'Individual') and not(WildMatch( [BBB_Individual],'*income*','*asset*','*cover*')) ,'Individual',
            if(WildMatch( [BBB_Individual],'BBB') and not(WildMatch( [BBB_Individual],'*income*','*asset*','*cover*')) ,'BBB',
            'N/A'
            ))
        )
    )
) as MergeField;
load 
[BBB/Individual] as [BBB_Individual] ,
[Net/Network] as [Net_Network] ;
Load * Inline [
BBB/Individual,Net/Network
BBB,Income
Individual,Income
Individual,Cover
BBB,Cover
BBB,Asset
];
 
exit Script;

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Rsaiq
Creator
Creator
Author

Hi @ajaykakkar93 

 

Thanks for your reply !!!

 

Everything is working fine but I am getting issue on 5th line of the expression. That line is not coming in the front end, I am wondering how this is happening.

Whatever line I am placing on last it is disappering on the front end. Some of the scenarios  I am atatching here.

1.

20230828_195416.jpg

 

2.

20230828_195406.jpg

Same is happening with 'Individaul' or 'BB Income' or 'BBB Cover' is placing on last line in the expression.

Could you kindly assist here. Thank You

vikasmahajan

hi,

you can make use of indirect set analyis  refer following post for the same.

https://community.qlik.com/t5/QlikView-App-Dev/Indirect-Set-Analysis-for-P-and-E/td-p/522117

 

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Rsaiq
Creator
Creator
Author

Hi @vikasmahajan 

 

Could you please create expression here using P() or E() as I am new to qliksense and I am confused by seeing that post.Thanks

ajaykakkar93
Specialist III
Specialist III

Hi,
do you have value in ignoring '*income*','*asset*','*cover*' in BBB ..

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Rsaiq
Creator
Creator
Author

Hi @ajaykakkar93 

 

I dont have '*income*','*asset*','*cover*' in BBB.

ajaykakkar93
Specialist III
Specialist III

hi,

I understand your requirements. You can create a link table to achieve this. The code below will be helpful.

ajaykakkar93_0-1693388808308.pngajaykakkar93_1-1693388826456.png

 

 

data:
load 
[BBB/Individual]&[Net/Network] as %key,
[BBB/Individual] as [BBB_Individual] ,
[Net/Network] as [Net_Network] ;
Load * Inline [
BBB/Individual,Net/Network
BBB,Income
Individual,Income
Individual,Cover
BBB,Cover
BBB,Asset
];
 
 
linkTable:
load %key,
filter
;
load 
[BBB/Individual]&[Net/Network] as %key,
[BBB/Individual] as [BBB_Individual] ,
[Net/Network] as [Net_Network],
filter;
Load * Inline [
BBB/Individual,Net/Network,filter
BBB,Income,BBB Income
Individual,Income,Individual Income
Individual,Cover,Individual Cover
BBB,Cover,BBB Cover
BBB,Asset,BBB Asset
BBB,Income,BBB
BBB,Cover,BBB
BBB,Asset,BBB
];
 
 
exit Script;

 

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Rsaiq
Creator
Creator
Author

Hi @ajaykakkar93 

 

Thank you so much ,It is now perfectly working !!!

ajaykakkar93
Specialist III
Specialist III

I appreciate it and hope it helped keep learning.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting