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

Exclude a specific value from a dimension's field

Hi All,

I have a dimension with a lot of values.

The name of dimension is "DB_User_Name_Comb_Machine_Learning".

I need to exclude a value with the name "DB_User_Name"

In the expression I have used "not Match", but it doesn't work.

DB_User_Name_Comb_Machine_Learning
If(not Match(DB_User_Name_Comb_Machine_Learning, 'DB_User_Name'),DB_User_Name_Comb_Machine_Learning)

Can you help me please?

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You should put both SET modifiers into one expression. Please take a look
at the expression below.

Count({<
High_volume_Outlier_Comb_Machine_Learning={"True"},
DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}
>}High_volume_Outlier_Comb_Machine_Learning)

View solution in original post

8 Replies
Vegar
MVP
MVP

Instead of manipulating the dimension you could just exclude the value from your expressions with SET analysis.
Try adding the set {$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>} into your expressions.
SUM(AMOUNT) would become
SUM({$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>}AMOUNT)
PaoloGuerra
Creator
Creator
Author

Hi @Vegar

sorry, but i don't understand.

I've 1 dimension and 6 measures with its expressions

Should i add this code in all expressions of the measures? 

{$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>}

Then, I don't understand where I can add this code:

SUM({$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>}AMOUNT)

Thanks

 

Vegar
MVP
MVP

You should i add this code in all expressions of the measures?

{$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>}


The code below was just an example on where inside your expressions you
should put the SET .
SUM( {$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>} AMOUNT)

Before implementing my suggested solution I would recommend you to read
this Qlik help page:
https://help.qlik.com/en-US/sense/November2018/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAn...
lfetensini
Partner - Creator II
Partner - Creator II

Hello Friend.

From what I understand, you're creating an expression to limit the content of your dimensions. As if it were a calculated dimension.

If yes, use the simple following formula:

If (DB_User_Name_Comb_Machine_Learning <> 'DB_User_Name', DB_User_Name_Comb_Machine_Learning)

Support your colleagues. Remember to "like" the answers that are helpful to you and flag as "solved" the one that helped you solve. Cheers.
PaoloGuerra
Creator
Creator
Author

Hi @Vegar

I can't add the code because there is an error.

This is the expression on the first measure

Count({<High_volume_Outlier_Comb_Machine_Learning={"True"}>}High_volume_Outlier_Comb_Machine_Learning)
{$<DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}>}

Error into expression

error.jpg

lfetensini
Partner - Creator II
Partner - Creator II

Are you trying apply two filters in Set Analisys? If yes, try:

Count(
{<
High_volume_Outlier_Comb_Machine_Learning = {"True"},
DB_User_Name_Comb_Machine_Learning -= {"DB_User_Name"} // Second filter after comma
>}
High_volume_Outlier_Comb_Machine_Learning
)
Support your colleagues. Remember to "like" the answers that are helpful to you and flag as "solved" the one that helped you solve. Cheers.
Vegar
MVP
MVP

You should put both SET modifiers into one expression. Please take a look
at the expression below.

Count({<
High_volume_Outlier_Comb_Machine_Learning={"True"},
DB_User_Name_Comb_Machine_Learning-={"DB_User_Name"}
>}High_volume_Outlier_Comb_Machine_Learning)
moumita
Contributor II
Contributor II

 

Hi, 

Please try below code in the expression editor to exclude DB_User_Name from DB_User_Name_Comb_Machine_Learning:-

if(DB_User_Name_Comb_Machine_Learning<>DB_User_Name,DB_User_Name_Comb_Machine_Learning)