Would someone please help with the below formula as I canโt see what is wrong with it and its not working. I have uploaded an image to show table formats.
IFS(
[Supplier]=โADA Fastfix - ADA02โ,Lookup([Product],โProduct Listโ,โProductSโ,โADA Fastfixโ,),
[Supplier]=โBSS - BSS01โ,Lookup([Product],โProduct Listโ,โProductSโ,โBSSโ),
[Supplier]=โWolseley - WOL01โ,Lookup([Product],โProduct Listโ,โProductSโ,โWolseleyโ)
)
@Martina
Try it like this:
SWITCH(
[Supplier],
"ADA Fastfix - ADA02", LOOKUP([_THISROW].[Product],"Product List","ProductS","ADA Fastfix"),
"BSS - BSS01", LOOKUP([_THISROW].[Product],"Product List","ProductS","BSS"),
LOOKUP([_THISROW].[Product],"Product List","ProductS","Wolseley")
)
Thank You, that seems to be working.
Hmm, Iโm curiousโฆ why the usage of [_THISROW] in the first two LOOKUPs but not the third?
@WillowMobileSystems
Itโs totally my badโฆThanks for your valuable attentionโฆFixed my post as well
It wasnโt meant as a critique at all! I have just been trying to truly understand when [_THISROW] is required and when its not.
I use the rule of thumb โwhen there is ambiguityโ such as the same column names between two data tables. But there seems to be outliers to this rule of thumb.
For instance, in this case there doesnโt seem to be any ambiguity so I donโt get why [_THISROW] is needed.
In other instances, when its not needed, the usage of it create problems - even though it seems it shouldnโt matter.
It leaves me a confused little man!!
I believe the most competent person who can explain this is @Aleksi
The [_THISROW] is needed when you need to say for the SELECT expression to read the column not from the same table you specified in the SELECT. The ANY(SELECT(โฆ)) experssion is typedโฆ
ANY(SELECT(Product List[ADA Fastfix],[ProductS]=[_THISROW].[Product])), which is equal toโฆ
LOOKUP([_THISROW].[Product],โProduct Listโ,โProductSโ,โADA Fastfixโ)
If you type the SELECT expression like SELECT(Product List[ADA Fastfix],[ProductS]=[Product]), it probably wonโt work if you donโt have the โProductโ column at all in your โProduct listโ table. If you type it likeโฆ SELECT(Product List[ADA Fastfix],[ProductS]=[ProductS]), the contidion is always TRUE and you will have all values from that table.
Soโฆ the SELECT expression is not able to know from which table it should read the value, if you donโt specify it with the [_THISROW]. Think it like [_FROM_THIS_RECORD] and it reads the value where you have that formula).
Thanks everyone
User | Count |
---|---|
43 | |
32 | |
25 | |
23 | |
14 |