Closed q3abhi closed 3 years ago
Preliminary comment: I do not recommend to use the execution
and equalTo
syntax but to switch to the new syntax result-set
and equal-to
. The old syntax that you're using is still supported but limited in terms of new features and will be deprecated.
Main answer: The issue is probably related to
<execution>
<query file="DaxQueries\CashReceipts\CashReceipts - Current.sql" />
</execution>
This query has no parameter defined.
@Seddryck
The parameter is defined in the "Assert" section as I am testing SSAS (System under test) and asserting it with sql.
<assert>
<equalTo>
<column index="0" role="key" type="text" tolerance="1"/>
<column index="1" role="value" type="numeric"/>
<column index="2" role="value" type="numeric"/>
<column index="3" role="value" type="numeric"/>
<column index="4" role="value" type="numeric"/>
<query file="SqlQueries\CashReceipts\CashReceipts - Current.sql">
<parameter name="DateKey" sql-type="Int">20200331</parameter>
</query>
</equalTo>
</assert>
Could you post your exact queries in the assert and system under test. I don’t see any reason why your query in system under test shouldn’t have a parameter but the query in assertion should.
I am trying to pass the variable as a parameter to my sql query.
This is my test. I am passing the variable (DateKey) declared in assert section.
This is my sql query defined in "CashReceipts - Current.sql" file. Using @DateKey to pass the value here.
When I run the test, I get the following error :
If I hard-code the value in sql query, test runs fine.