QlikView. التنسيق الشرطي "مثل في Excel"

وتتمثل المهمة في جعل التنسيق الشرطي للجدول "مثل في Excel." QlikView قادر تمامًا على التعامل مع المهام القياسية للتلوين حسب الشرط ، ولكن مع اختيار المعلمات بشكل ديناميكي ، وحتى في Excel ، فإن السؤال الذي يطرح نفسه هو: "هل مثل هذا على الإطلاق ..؟".
خلاصة القول: كان هناك العديد من خيارات التنفيذ ، العديد من الإصدارات ، وقضى الكثير من الوقت في الاختبار والتصحيح. تم تنفيذ إعادة إحياء التنفيذ النهائي. أقدم الإصدار النهائي ، تلبية احتياجات العملاء ، واختبارها والتحقق منها.

المهمة الوظيفية (بيان)


يوجد جدول يتم فيه تحديد الأبعاد والتعبيرات بشكل حيوي ، والصيغ لحساب القيم نفسها بسيطة: الكميات ، المتوسط ​​، النسب المئوية النسبية ، القيم المطلقة ، وما شابه.

يجب تمكين المستخدم من تلوين الجدول اعتمادًا على المعلمات المحددة. مقدمة أساسية - يجب أن يكون عمود واحد قادرًا على الطلاء بألوان مختلفة ، أي متعدد الألوان ، وفقًا لمعايير مختلفة. يجب أن يكون المفتاح الثاني هو القدرة على تلوين الحقل اعتمادًا على "معلمات مترابطة" أخرى ، على سبيل المثال ، نقوم بتلوين "مبلغ الشراء" اعتمادًا على قيمة "متوسط ​​سعر المنتجات في السوق".
ما يلي هو الجزء الرئيسي من التنفيذ. لن أتطرق إلى أشياء مثل إخفاء / إغلاق القوائم وإنشاء قوائم وما شابه ذلك. إذا كان لديك أسئلة حول التفاصيل سأقول بالإضافة إلى ذلك.

النتيجة النهائية ، الطريق الذي كان شائكًا:



كتلة 1. إعداد البيانات لقائمة الوظائف


يعد الكود الأساس لقوائم القائمة الموضحة في المربع رقم 3
tColorsFormatListSelection: LOAD * INLINE [%ColorDisplayNameFormat      n   n%  n   n%     ]; tFilterTypeListSelection: LOAD * INLINE [%FilterDisplayNameType    ]; tColorsTableList: LOAD*INLINE [%ColorDisplayName|%ColorRGBValue|%SortColorList -| RGB(192,0,0)|1 | RGB(255,0,0)|2 | RGB(255,192,0)|3 | RGB(255,255,0)|4 -| RGB(146,208,80)|5 | RGB(0,176,80)|6 -| RGB(0,176,240)|7 | RGB(0,112,192)|8 -| RGB(0,32,96)|9 | RGB(112,48,160)|10 ](delimiter is '|'); tColorFieldsListSelectionRelation: Load [ Qlik] AS %ColorFieldName, [/] AS %ExpressionType D:\QLIK\Data\Mapped_fields.xlsx (ooxml, embedded labels, table is [MetaField]) WHERE Match([/],'',''); tColorFieldsListSelectionClause: Load [ Qlik] AS %ColorFieldNameClause, [/] AS %ExpressionTypeClause FROM D:\QLIK\Data\Mapped_fields.xlsx (ooxml, embedded labels, table is [MetaField]) WHERE Match([/],''); 


كنت بحاجة أيضًا إلى إنشاء عدة عشرات من المتغيرات:



vColorFormatString - سلسلة تم جمعها

vColorFormatString1 ... 10 - تم تصميمه لتحليل سلسلة من vColorFormatString إلى 10 معلمات للقيم المطلقة ، لقد قمت بهذا التقييد عمداً ، في رأيي أنه لم يعد ضروريًا ، بشكل عام ، هذا التقييد أيديولوجي بحت وبقضاء بعض الوقت يمكنك زيادة عدد المعلمات.

vColorFormatStringPerc1 ... 10 - مصمم لتحليل سلسلة من vColorFormatString إلى 10 معلمات للقيم النسبية (النسبة المئوية)

vColorFormat1 ... 10 - الألوان

كتلة 2. تطوير menu1 وظيفية




الغرض:

  1. يعرض القائمة الحالية للمعلمات التي تم إنشاؤها بواسطة المستخدم.
  2. القدرة على إزالة أي خيار التنسيق الشرطي
  3. يستدعي قائمة لتحديد خيارات التنسيق الشرطي.

دعونا نتحدث عن العنصرين أدناه.

الأول هو عرض المعلمات التي تم إنشاؤها حاليا.

هذه المنطقة عبارة عن كائنات نصية تعرض المعلمات الحالية التي تم إنشاؤها بناءً على تحليل السلسلة. والآن أول لبنة من هذا العمل كله:

صيغة عرض النص
 = SubField(TextBetween(vColorFormatString,'||','||',1),'|',1) & '' & If(SubField(TextBetween(vColorFormatString,'||','||',1),'|',1) = SubField(TextBetween(vColorFormatString,'||','||',1),'|',2),'', SubField(TextBetween(vColorFormatString,'||','||',1),'|',2)) & ' ('& SubField(TextBetween(vColorFormatString,'||','||',1),'|',4) & ' '& If( Index(SubField(TextBetween(vColorFormatString,'||','||',1),'|',2),'%')>0 OR Index(SubField(TextBetween(vColorFormatString,'||','||',1),'|',4),'%')>0, If(WildMatch( SubField(TextBetween(vColorFormatString,'||','||',1),'|',4),'**'),'', num($(=SubField(TextBetween(vColorFormatString,'||','||',1),'|',5)),'# ##0,00')) & ' % '& If(WildMatch( SubField(TextBetween(vColorFormatString,'||','||',1),'|',6),'*Empty*'),'', num($(=SubField(TextBetween(vColorFormatString,'||','||',1),'|',6)),'# ##0,00')&' %') , If(WildMatch( SubField(TextBetween(vColorFormatString,'||','||',1),'|',4),'**'),'', num($(=SubField(TextBetween(vColorFormatString,'||','||',1),'|',5)),'# ##0.0')) & ' '& If(WildMatch( SubField(TextBetween(vColorFormatString,'||','||',1),'|',6),'*Empty*'),SubField(%EdName,',',1), num($(=SubField(TextBetween(vColorFormatString,'||','||',1),'|',6)),'# ##0.0')& ' ' &SubField(%EdName,',',1) ) )& ')' 


بعض الرعب ، أليس كذلك؟ :)

الآن أعتقد أنه أصبح من الواضح للكثيرين أن كل المنطق يتم تنفيذه على سطر نصي. جمعت خطًا - فرز خط!

يحتوي تجميع السلسلة على النموذج

|| RWA٪ | RWA٪ | RGB (255،0،0) | أعلى من المتوسط ​​| num (vColorFormatValue1 / 100، '# ## 0،00') | فارغ
|| CODE٪ | CODE٪ | RGB (255،0،0) | أقل من المتوسط ​​| num (vColorFormatValue1 / 100، '# ## 0،00') | فارغ
|| GCD٪ | GCD٪ | RGB (255،0،0) | أقل من المتوسط ​​| num (vColorFormatValue1 / 100، '# ## 0،00') | فارغ
| RORWA٪ | RORWA٪ | RGB (255،0،0) | أقل من المتوسط ​​| دائري (رقم (124.63) ، 0.0001) | فارغ
|| EL٪ | EL٪ | RGB (255،255،0) | أعلى من المتوسط ​​| دائري (رقم (124.62) ، 0.0001) | فارغ
|| EL٪ | EL٪ | RGB (0،176،80) | أقل من المتوسط ​​| دائري (رقم (124.62) ، 0.0001) | فارغ
| OD٪ | OD٪ | RGB (0،112،192) | أقل من المتوسط ​​| دائري (رقم (124.62) ، 0.0001) | فارغ
||

دعونا تحليل الخط

|| WhatColor | ما القيمة | اللون | الشرط | القيمة 1 | و value2

فهارس في الجزء SubField (TextBetween (vColorFormatString ، '||' ، '||' ، 1) ، '|' ، 4) - يتم تمييز تعبير كل معلمة بواسطة '|| '||' ، تعبيرات الملكية مفصولة بعبارة '|' وبالتالي ، يقول الفهارس 1 و 4 أن تأخذ الكتلة الأولى من المعلمات ومنه القيمة الرابعة.

قيمتان (Value1 ، Value2) للمعلمة "بين".

دعنا نذهب أبعد من ذلك ...

إزالة المعلمة هي في الأساس "إعادة" للقيمة في السلسلة.

رمز لحذف معلمة التنسيق الشرطي
=Replace(vColorFormatString, '||' & TextBetween(vColorFormatString,'||','||',1),'')

كتلة 3. تطوير menu2 وظيفية


Kartinka1


Kartinka2


Kartinka3


القائمة الرئيسية لجمع المعلمات. مرة أخرى ، لن أتطرق إلى عناصر القوائم وأوصاف منطقهم لإخفاء الإغلاق.

المنطق الرئيسي لخطنا هو جمع كل ما يطالب به المستخدم في هذه القائمة إلى زر "جاهز".

الإجراء "set variable" هو vColorFormatString ، الكود:
 =If( SubStringCount(vColorFormatString,'||')<11 AND ( (vColorParamByClause=0 AND ( (Len(GetFieldSelections(%ColorFieldName))>0 AND Len(GetFieldSelections(%ColorFieldNameClause))>0) AND (GetFieldSelections(%ColorFieldName) <> GetFieldSelections(%ColorFieldNameClause)) )) OR (vColorParamByClause=1 AND Len(GetFieldSelections(%ColorFieldNameClause))>0) ), If(vColorParamByClause=0, if(len(vColorFormatString)<1, '||' & Trim(GetFieldSelections(%ColorFieldName,'|',50)) &'|' & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50)) &'|' & $(=only({<%ColorDisplayName={"$(=SubField(concat(%ColorDisplayName,',',%SortColorList),',',1))"}>}%ColorRGBValue)) &'|'& GetFieldSelections(%ColorDisplayNameFormat,'|',1) & '|'& vColorFormatValue1Transform & '|'& If(GetFieldSelections(%ColorDisplayNameFormat,1) ='', vColorFormatValue2Transform,'Empty') & '||', vColorFormatString & Trim(GetFieldSelections(%ColorFieldName,'|',50)) &'|' & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50)) &'|' & $(=only({<%ColorDisplayName={"$(=SubField(concat(%ColorDisplayName,',',%SortColorList),',',1))"}>}%ColorRGBValue)) &'|'& GetFieldSelections(%ColorDisplayNameFormat,'|',1) & '|'& vColorFormatValue1Transform & '|'& If(GetFieldSelections(%ColorDisplayNameFormat,1) ='', vColorFormatValue2Transform,'Empty') &'||' ) , if(len(vColorFormatString)<1, '||' & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50)) &'|' & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50)) &'|' & $(=only({<%ColorDisplayName={"$(=SubField(concat(%ColorDisplayName,',',%SortColorList),',',1))"}>}%ColorRGBValue)) &'|'& GetFieldSelections(%ColorDisplayNameFormat,'|',1) & '|'& vColorFormatValue1Transform & '|'& If(GetFieldSelections(%ColorDisplayNameFormat,1) ='', vColorFormatValue2Transform,'Empty') & '||', vColorFormatString & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50))&'|' & Trim(GetFieldSelections(%ColorFieldNameClause,'|',50)) &'|' & $(=only({<%ColorDisplayName={"$(=SubField(concat(%ColorDisplayName,',',%SortColorList),',',1))"}>}%ColorRGBValue)) &'|'& GetFieldSelections(%ColorDisplayNameFormat,'|',1) & '|'& vColorFormatValue1Transform & '|'& If(GetFieldSelections(%ColorDisplayNameFormat,1) ='', vColorFormatValue2Transform,'Empty') &'||' ) ), vColorFormatString ) 


كتلة 5. تحليل النص


رمز المتغيرات هو vColorFormatString1 ... 10.

تتمثل النقطة الرئيسية لكل من المتغيرات العشر في تغيير الفهرس الخاص بـ SubField SubField (TextBetween (vColorFormatString، '||'، '||'، 1 ) - vColorFormatString 1 ، الفهرس 1.

ل vColorFormatString 4 - على التوالي
SubField (TextBetween (vColorFormatString، '||'، '||'، 4 )

القيمة المطلقة تحليل رمز المتغير
 =If(Len(SubField(TextBetween(vColorFormatString,'||','||',4),'|',4))>0, Pick(Match(SubField(TextBetween(vColorFormatString,'||','||',4),'|',4) ,'','','','',' n ',' n%',' n ',' n%',' ',' '), // 'round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)' & '>' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), // 'round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)' & '<' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), // 'round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)' & '>' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)') &' AND '& 'round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)' & '<' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',6)'), // 'round(sum(DISTINCT ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)' & '=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), // n  'num(rank(if(round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)>0, sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']))/$(=%Value),1))' & '<=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), // n% '100-((sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']) / SUM( TOTAL ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']))*100) < ' & '100-' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)') , // n  'num(rank(if(round(sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])/$(=%Value),1)>0, -sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']))/$(=%Value),1))' & '<=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), // n% '((sum(['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']) / SUM( TOTAL ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &']))*100) < ' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',4),'&chr(39)&'|'&chr(39)&',5)'), //  'sum(DISTINCT ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])>= Median(TOTAL <$(vGroupByList)> ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])', //  'sum(DISTINCT ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])<= Median(TOTAL <$(vGroupByList)> ['& Trim(SubField(TextBetween(vColorFormatString,'||','||',4),'|',2)) &'])' ),'0>1') 


من أجل الاهتمام ، المحتوى أكثر تعقيدًا
 =If(Len(SubField(TextBetween(vColorFormatString,'||','||',2),'|',4))>0 AND $(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')')>0, Pick(Match(SubField(TextBetween(vColorFormatString,'||','||',2),'|',4) ,'','','','',' n ',' n%',' n ',' n%',' ',' '), // Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & '>' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), // Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & '<' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), // Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & '>' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)') &' AND '& Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & '<' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',6)'), // Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & '=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), // n  Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), 'num(rank($(vELPercFormula),1))','num(rank($(vNODPercFormula),1))','num(rank($(vODPercFormula),1))','num(rank($(vKODPercFormula),1))','num(rank($(vRWAPercFormula),1))','num(rank($(vRWAPercRORWAFormula),1))','num(rank($(vRORWAPercFormula),1))') & '<=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), // n% Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & ' < 100-' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)') , // n  Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), 'num(rank(-$(vELPercFormula),1))','num(rank(-$(vNODPercFormula),1))','num(rank(-$(vODPercFormula),1))','num(rank(-$(vKODPercFormula),1))','num(rank(-$(vRWAPercFormula),1))','num(rank(-$(vRWAPercRORWAFormula),1))','num(rank(-$(vRORWAPercFormula),1))') & '<=' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), // n% Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), '$(vELPercFormula)','$(vNODPercFormula)','$(vODPercFormula)','$(vKODPercFormula)','$(vRWAPercFormula)','$(vRWAPercRORWAFormula)','$(vRORWAPercFormula)') & ' < ' & $(='SubField(TextBetween(vColorFormatString,'&chr(39)&'||'&chr(39)&','&chr(39)&'||'&chr(39)&',2),'&chr(39)&'|'&chr(39)&',5)'), //  Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), 'round($(vELPercFormula),0.0001) > round($(vELPercTOTALFormula),0.0001)', 'round($(vNODPercFormula),0.0001) > round($(vNODPercTOTALFormula),0.0001)', 'round($(vODPercFormula),0.0001) > round($(vODPercTOTALFormula),0.0001)', 'round($(vKODPercFormula),0.0001) > round($(vKODPercTOTALFormula),0.0001)', 'round($(vRWAPercFormula),0.0001) > round($(vRWAPercTOTALFormula),0.0001)', 'round($(vRWAPercRORWAFormula),0.0001) > round($(vRWAPercRORWAFormulaTotal),0.0001)', 'round($(vRORWAPercFormula),0.0001) > round($(vRORWAPercTotalFormula),0.0001)'), //  Pick($(='WildMatch('& chr(39) & SubField(TextBetween(vColorFormatString,'||','||',2),'|',2)&chr(39) & ',' &chr(39)&'EL %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &',' &chr(39)&' %'&chr(39) &','& chr(39)&'RWA %'&chr(39) &','& chr(39)&'RWA%(RORWA)'&chr(39) &','& chr(39)&'RORWA%'&chr(39) &')'), 'round($(vELPercFormula),0.0001) < round($(vELPercTOTALFormula),0.0001)', 'round($(vNODPercFormula),0.0001) < round($(vNODPercTOTALFormula),0.0001)', 'round($(vODPercFormula),0.0001) < round($(vODPercTOTALFormula),0.0001)', 'round($(vKODPercFormula),0.0001) < round($(vKODPercTOTALFormula),0.0001)', 'round($(vRWAPercFormula),0.0001) < round($(vRWAPercTOTALFormula),0.0001)', 'round($(vRWAPercRORWAFormula),0.0001) < round($(vRWAPercRORWAFormulaTotal),0.0001)', 'round($(vRORWAPercFormula),0.0001) < round($(vRORWAPercTotalFormula),0.0001)') ),'0>1') 


الفرق هو أنني قمت أيضًا بخياطة صيغ القيمة النسبية في متغيرات واستبدالها وفقًا لمحتويات السلسلة. لم تكن تعمل بطريقة مختلفة أو لم تعمل دائمًا بشكل ثابت ، فقد اعتبرت ملتوية ... بشكل عام ، كانت القيم المطلقة والنسبية في متغير تحليل واحد وكانت عملية مرهقة للغاية ، وكان من المستحيل عمليًا البحث عن خطأ في الشفرة أو حسابات ، لتحليل ما تمت كتابته. لذلك ، تقرر تقسيم - parsim مطلق في بعض المتغيرات ، في المئة في غيرها.

كتلة 6. إضافة إعدادات إلى الجدول


حسنًا والأهم من ذلك ، أنت الآن بحاجة إلى رسم الجدول استنادًا إلى ما قمنا بتوزيعه ، رمز جميع حقول الجدول متطابق ، باستثناء شرط الإدخال لتسمية الحقل ، لذلك كان عليّ أن أدق كل شيء يدويًا ، لا أتمتة ، وبشكل أكثر دقة في مكان ما في العمود 15 ، الأتمتة يتم إنتاجه في عضلات الأصابع ، وتطوير ذاكرة العضلات. إضافي

على سبيل المثال ، بالنسبة لحقل "معرف CRM" في الجدول ، يحتوي الرمز على النموذج
 if(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',1),'|',1)) AND ($(vColorFormatString1) OR $(vColorFormatStringPerc1)),$(vColorFormat1), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',2),'|',1)) AND ($(vColorFormatString2) OR $(vColorFormatStringPerc2)),$(vColorFormat2), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',3),'|',1)) AND ($(vColorFormatString3) OR $(vColorFormatStringPerc3)),$(vColorFormat3), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',4),'|',1)) AND ($(vColorFormatString4) OR $(vColorFormatStringPerc4)),$(vColorFormat4), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',5),'|',1)) AND ($(vColorFormatString5) OR $(vColorFormatStringPerc5)),$(vColorFormat5), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',6),'|',1)) AND ($(vColorFormatString6) OR $(vColorFormatStringPerc6)),$(vColorFormat6), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',7),'|',1)) AND ($(vColorFormatString7) OR $(vColorFormatStringPerc7)),$(vColorFormat7), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',8),'|',1)) AND ($(vColorFormatString8) OR $(vColorFormatStringPerc8)),$(vColorFormat8), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',9),'|',1)) AND ($(vColorFormatString9) OR $(vColorFormatStringPerc9)),$(vColorFormat9), If(Match('CRM ID',SubField(TextBetween(vColorFormatString,'||','||',10),'|',1)) AND ($(vColorFormatString10) OR $(vColorFormatStringPerc10)),$(vColorFormat10), )))))))))) 


على سبيل المثال ، بالنسبة للحقل "AMOUNT" في الجدول ، يحتوي الرمز على النموذج
 if(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',1),'|',1)) AND ($(vColorFormatString1) OR $(vColorFormatStringPerc1)),$(vColorFormat1), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',2),'|',1)) AND ($(vColorFormatString2) OR $(vColorFormatStringPerc2)),$(vColorFormat2), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',3),'|',1)) AND ($(vColorFormatString3) OR $(vColorFormatStringPerc3)),$(vColorFormat3), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',4),'|',1)) AND ($(vColorFormatString4) OR $(vColorFormatStringPerc4)),$(vColorFormat4), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',5),'|',1)) AND ($(vColorFormatString5) OR $(vColorFormatStringPerc5)),$(vColorFormat5), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',6),'|',1)) AND ($(vColorFormatString6) OR $(vColorFormatStringPerc6)),$(vColorFormat6), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',7),'|',1)) AND ($(vColorFormatString7) OR $(vColorFormatStringPerc7)),$(vColorFormat7), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',8),'|',1)) AND ($(vColorFormatString8) OR $(vColorFormatStringPerc8)),$(vColorFormat8), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',9),'|',1)) AND ($(vColorFormatString9) OR $(vColorFormatStringPerc9)),$(vColorFormat9), If(Match('AMOUNT',SubField(TextBetween(vColorFormatString,'||','||',10),'|',1)) AND ($(vColorFormatString10) OR $(vColorFormatStringPerc10)),$(vColorFormat10), )))))))))) 


هذا هو الأساس. إذا وصفت كل عنصر من عناصر القائمة ، فستحصل على كتاب كامل ، مثل دليل التدريب. آسف إذا كان شخص ما يفتقر إلى التفاصيل.

PS
أدرك أنه من المحتمل أن يتم ذلك على نحو أكثر أناقة ، ولكن عندما تكون بالفعل في هذه العملية ، فلن تطير إلا الرقائق. لا أرغب حقًا في وصف جميع تفاصيل تنفيذ القائمة ، ولماذا لا. بشكل عام ، يهدف المقال إلى توضيح كيف يمكنك القيام بذلك ، وربما يلهم شخصًا ما ، وستظهر فكرة أكثر دقة عن التنفيذ.

Source: https://habr.com/ru/post/ar446076/


All Articles