Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I ask for help in working with variables.
I load variables from an Excel file.
For example, vFact and vPlan. After I begin to conduct mathematical operations on them, the result behaves quite strangely.
For example, the expression =$(vFact) / $(vPlan) displays a huge number, although if you take the value of each variable separately, everything is fine.
By trial and error, I came to this result.
I do not understand why, but if you write each variable in a new line, it works as it should.
// Not work
$(FactSales_CM_TD_Exec) / $(PlanSales_CM_TD_Exec)
// Good work
$(FactSales_CM_TD_Exec)
/
$(PlanSales_CM_TD_Exec)
// If use braces, they must be write in new line too
// Good work (if use braces)
(
$(FactSales_CM_TD_Exec)
/
$(FactChecks_CM_TD_Exec)
)
/
(
$(PlanSales_CM_TD_Exec)
/
$(PlanChecks_CM_TD_Exec)
)
Try to explain your input data of excel with variables? And what you are getting then what you needed?
I'm using a download from a table with variables.
[Temp_Expressions]:
Replace only
LOAD
ID_Expression,
Name,
Expression,
Comment,
Feature
FROM
(ooxml, embedded labels, table is EXPRESSIONS);
FOR i = 0 to NoOfRows('Temp_Expressions') - 1
LET vName = Peek('Name', i, 'Temp_Expressions');
LET vComment = Peek('Comment', i, 'Temp_Expressions');
LET vFeature = Peek('Feature', i, 'Temp_Expressions');
LET $(vName) = Peek('Expression', i, 'Temp_Expressions') & '// $(vFeature):' & ' $(vComment)' ;
NEXT i
Sample Source
ID_Expression | Name | Expression |
1 | CountTT_CM_TD | Count(DISTINCT {$<CM_TD={1}>} [ID ФИЛИАЛА]) |
2 | FactSales_CM_TD_Exec | Sum({$<[НАЗВАНИЕ КАНАЛА]-={'Производитель'},[ID ТИПА ДОКУМЕНТА]={2,7,10}, [ВИД КОКУМЕНТА]={1,2,4,15,19,20,27,28,29,30}, CM_TD={1}>}([СУММА С НДС]*[ТИП ОПЕРАЦИИ])) |
3 | FactChecks_CM_TD_Exec | Count(DISTINCT{$<[НАЗВАНИЕ КАНАЛА]-={'Производитель'},[ID ТИПА ДОКУМЕНТА]={2,7,10}, [ВИД КОКУМЕНТА]={1,2,4,15,19,20,27,28,29,30}, CM_TD={1}>}DOC_FILIAL_KEY) |
4 | FactQuantity_CM_TD_Exec | Sum({$<[НАЗВАНИЕ КАНАЛА]-={'Производитель'},[ID ТИПА ДОКУМЕНТА]={2,7,10}, [ВИД КОКУМЕНТА]={1,2,4,15,19,20,27,28,29,30}, CM_TD={1}>}([КОЛ-ВО]*[ТИП ОПЕРАЦИИ])) |
When you say =$(vFact) / $(vPlan) receive huge number. I am expecting try to split into 2 variables of 2 text boxes like 1) $(vFact)
2) $(vPlan)
Then let us know the values you are getting and then tell us the result you are expecting?
Separately, each
$(vFact) = 85 345 706
$(vPlan) = 85 377 077
Division
$(vFact) / $(vPlan) = 85 342 240,17
Must be
$(vFact) / $(vPlan) =0,9963 ...
Is your vFact formula of the form A - B?
If yes that would explain the issue you are having as you would get A - B / vPlan.
Try writing the formula as ($(vFact)) / ($(vPlan)).
What are you getting when you use vFact / vPlan ??
I wrote above:
$(vFact) / $(vPlan) = 85 342 240,17
I wrote above:
$(vFact) / $(vPlan) = 85 342 240,17
But, My reply is
What are you getting when you use vFact / vPlan ??