Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
matancha
Creator
Creator

Compare Two Field From 2 Tabels

Hello All.

I have this situation:

     2 stright-table. (Row 2 is expression)

PartArc.PartNameStandard value(Kg)Std.value-Prod(Kg)
Sum(PartArc.Coef * Serial.Quant),(Sum(PartArc.Coef * Serial.Quant)/Serial.Quant) *  Sum(Aline.Quant)
431.82446.21
30001003284.1586.96
300010033252.54260.96
3000200082.522.60
3000200121.711.77
3000300075.045.21
30004001247.1648.73
30005000338.7039.99

Transorder.PartNameActual value(Kg)Gap(%)
Sum(Transorder.Quant)(Prod-Act)/Act
657.8-
300010032155.24-
300010033428.07-
3000200084.04-
3000200122.7-
3000300077.91-
30005000359.84-

What I Want to Show Is:

PartNameStandard value(Kg)Std.value-Prod(Kg)Actual value(Kg)Gap(%)
431.82446.21657.8-
30001003284.1586.96155.2485.955
300010033252.54260.96428.07259.958
3000200082.522.604.041.604
3000200121.711.772.70.767
3000300075.045.217.914.208
30004001247.1648.73-
30005000338.7039.9959.8438.99

How can I do that ( PartName Dimension?) ?

Table View:

TableWiew.JPG

  

Thks.

16 Replies
matancha
Creator
Creator
Author

Hi Stefan,

I have take a quick look, and it's look better....

I hope that's the way.

I'll check it on my document on sunday (a short vacation...).

Thanks a million!!!

Matan.

swuehl
MVP
MVP

Hi Matan,

you're welcome.

What I basically have done is that I added the creation of overall PartName List in the load script and very simple expressions in the straigt table. So after I got the right idea, I think it is quite straigt forward.

If you need more info, please let me know.

Best regards and have a nice short vacation,

Stefan

matancha
Creator
Creator
Author

Hi Stefan.

It's Work!!!

Tnks!!!

Matan.

matancha
Creator
Creator
Author

Hi Stefan.

Just one question...

Why do you need this:

" where not exists (PartName, PartArc.PartName) "

on  the script?

It's work fine without this.

Tnks you in advance -
Matan.
swuehl
MVP
MVP

Hi Matan,

you're results are the same without that filter?

That's strange, if I remove that part, I get double value in in the comparison table, column 3 (recipe ingredients), for all ingredients that are used in recipe as well as actually used e.g. apple in Applecake = 1720 instead of 860.

I thought, that because of the double entries in the Partname table, the sum is executed twice. With given expression, I limited Partname table to one entry per ingredient.

(I already added the number of entries in the table in the Partname Listbox as expression).

If this expression has no effect in your application, I am a bit clueless.

Could you check that you get the same results in both cases in the comparision table, column recipe ingredients?

But I am glad, that you got it working.

Have a nice week,

Stefan

matancha
Creator
Creator
Author

Hi Stefan.

Sorry for the late response...

It's my mistake. In my model, on the script I use the Load Distinct statment instead of "where not exsist..."  , So I'm not get duplicate records.

What your opinion?  If it's good? Wich method is better?

Thank you -

Matan.

swuehl
MVP
MVP

Hi Matan,

I think the two methods are equivalent in our case.

{As far as I know, the load distinct method will restrict the table to distinct values even on further adding fields / rows (further loads to the logical table, even without Distinct keyword), but even that should be ok.}

I am glad, that we got it working, it was a good exercise for me, too.

Regards,

Stefan