Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - field1 to follow field2 values?

<body><p>Hi guys,</p> <p>I have a table that looks like shown below. </p> <p>The dimension is the month of the targets. </p> <p>The first column is the sum of target sales:   Sum(SalesTargets.Quant)</p> <p>The second column SHOULD BE the sum of the sales:   =Sum(QtyByBaseProduct)</p> <p>Since there is no relation between "Target Month" and "Sales Month", I am trying to change the expression in the second column in order to show "Sales Month" that correspond to the "Target Month" shown in the first column. </p> <p>In the second column, I am trying something like:  =Sum({&lt;[IvMonthNo] = {$(=[SalesTargets.STMonth])}&gt;}  QtyByBaseProduct)</p> <p>But that works only when I select a specific month from "Target Month". </p> <p>How can I work it around?</p> <p>Thanks in advance,</p> <p>Aldo. </p> <p>T.Month  Target   Sales</p> <p>01               915        0</p> <p>02               988        0</p> <p>03               1061      0</p> <p>... </p> <p>12                1354     0</p> <p> </p> <p><col width="76"></col> <col width="153"></col> <col width="142"></col> <tr height="20"> <td height="20" class="xl63" width="76"><br /></td> <td class="xl64" width="153"><br /></td> <td class="xl64" width="142"><br /></td> </tr> </p> <p> </p></body>

15 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Aldo

Not sure what the problem is. I would check that the DateIsland table has the number of records you would expect (check via the Table Viewer), and I would also check the values of vMinTrDate and vMaxTrDate (put =Date(vMinTrDate) into a text box).

BTW and off-topic - you don't really need to create field TrMonthNo, as TrMonth is a dual value, having a text form of the month short name, and a numerical value equal to the month number.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Dushyant

It is very hard to make sense of your post with the script spread out like that.

When posting code I suggest that you copy the script to a text editor (notepad is fine) and then into your post, and wrap the code in a code tags. See http://community.qlik.com/forums/t/15789.aspx for more info.

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Jonathan,

I checked the variables and everything seems to be okay. I am still trying to make it work...

Thanks for your help,

Aldo.

Anonymous
Not applicable
Author

Aldo,

Looks like it's getting much more complex when it should be. If you upload your application, I think it would take a few minutes to help. Except I will not have free time in the next 10 hours or so...
If nobody replies by then, I'll upload a simple example.

Anonymous
Not applicable
Author

Hi Aldo,

See attached very simple example. I hope it will help to resolve your problem.

Not applicable
Author

Thanks man,

I will try it and let you know.

Aldo.