Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Prabhu1204
Creator
Creator

Ignore Filed

Hello  All and   @MayilVahanan 

I have one requirement to Exclude the entire field values, if the rule of the field set to "nO"

Is it possible in Qliksense

Can you help me on this.

Prabhu1204_0-1618925118397.png

 

In this example I need to exclude the Sales Detail3  field

 

-Prabhu
5 Replies
edwin
Master II
Master II

if i understand thsi correctly, you want to add the modifier Field= inside your set aanlysis, but you want that based on a value for the field.  i cant imagine how this will be maintained but to answer the specific question, you can create a variable say vSalesDetail3SA, this can contain 
[Sales Detail 3]=,
if you want the rule applied or blank if not:

vSalesDetail3SA = if(applyRule, '[Sales Detail 3]=,', '')

then add it into your set analysis:

...{<$(vSalesDetail3SA) OtherField=>}...

so when it is evaluated, it will have the field ignored or not depending on your rule.  be careful with the comma at the end.  this assumes that there will be other modifiers in your expressions' set analysis.

hope that helps

MayilVahanan

Hi

Do you want to exclude the field from data model? or exclude from expression?

And also, exclude field is dynamic or static field?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Prabhu1204
Creator
Creator
Author

I want to exclude from Data model and this is dynamic,

 

In one input file it is Sales detail3 in other file it may be sales details 6,sales details10 should be ignored.

The fields are not static

-Prabhu
MayilVahanan

Hi @Prabhu1204 

This is small POC for your requirement. Alter based on ur requirement.

Set vExclude = 'CATEGORY';
T1:
LOAD * INLINE [
NAME, CATEGORY, PRIORITY
SHOP1, APPLE, 1
SHOP4, TOMATO, 4
SHOP3, PINEAPPLE, 3
SHOP1, GRAPES, 2
SHOP2, APPLE, 1
SHOP5, TOMATO, 4
SHOP2, PINEAPPLE, 3
SHOP2, GRAPES, 2
SHOP3, GRAPES, 2
SHOP5, ROSE, 5
SHOP4, ROSE, 5
];
Let vFields = '';
For i = 1 to NoOfFields('T1')
Field:
Load FieldName($(i), 'T1') as Field AutoGenerate 1;
next

LOAD Concat(DISTINCT Fields , ',') as Fields where Len(Trim(Fields))>0;
Load Replace(Field,'$(vExclude)','') as Fields Resident Field;

DROP Table Field;

Let vFields = Peek('Fields');

Load $(vFields) Resident T1;
DROP Table T1;

vExclude <-- field will exclude from the data model

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Prabhu1204
Creator
Creator
Author

@MayilVahanan 

Thank you,. let me try and give you an update

-Prabhu