Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
In this example I need to exclude the Sales Detail3 field
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
Hi
Do you want to exclude the field from data model? or exclude from expression?
And also, exclude field is dynamic or static field?
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
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
@MayilVahanan
Thank you,. let me try and give you an update