Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Multiple number values in condition or variable.
alecsia
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">Good morning!</span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">I need some help regarding multiple conditions in the Expression Builder.</span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">I need PERSONAL_ID to be counted based on two conditions: <span style="color:#000000;">row[</span><span style="color:#2a00ff;">"C_CATEGORY_POSITION"</span><span style="color:#000000;">] must be 1</span>, and <span style="color:#000000;">row[</span><span style="color:#2a00ff;">"AGE"</span><span style="color:#000000;">] must equal 59 and 60 simultaneously. </span></span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;"><span style="color:#000000;">For this purpose I write very simple expression in the Builder Expression of the Aggregation option:</span></span></span></p>
<pre class="_prettyXprint">
if (row["C_CATEGORY_POSITION"] == 1 && row["AGE"] == 59){row["PERSONAL_ID"]}</pre>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">This works perfectly when I equal row["AGE"] to only one number, but how can I insert two or more numbers? I even tried to declare a variable there, but I didn’t get any results…</span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">Also I tried to create a separate Variable in the Data Explorer, I created a Report Variable with Default Value. And again when I insert only one value it works perfectly.</span></span></p>
<p> </p>
<p><span style="font-size:14px;"><span style="font-family:arial, helvetica, sans-serif;">How can I set many number values to a Variable or in condition?</span></span></p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Try building your aggregation as follows:</p>
<p>
alecsia
<p>Thank you a lot, this works exactly as I wanted!!! </p>