8 Replies Latest reply on Apr 27, 2018 4:08 PM by Kevin Esther

# LOD Find The First Instance of volume > 20 then Return the Age

Hi,

I have created calculated field using a Fixed LOD. I have managed to write LOD to return the age given the below conditions

Find == (Level = Level AND Volume > 10)

However the data test data was at the above level however the original  = 1 record per row.

I have also have built sets as there about five columns of data that make up the department and level so this is why I have set in and out.

I might just be overthinking this and cover complicating the calculation.

Reason went with LOD is that the view will be changing so thought this would be the best approach.

Thanks

Kev

• ###### 1. Re: LOD Find The First Instance of volume > 20 then Return the Age

Good morning

Is this what you are looking for

this is the formula

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 2. Re: LOD Find The First Instance of volume > 20 then Return the Age

HI Kevin

Pretty hard to understand you logic,

What is 10 , what is 20, what is set in/out?

Could you clarify what you want to achieve step by step..

Thanks,

Shin

• ###### 3. Re: LOD Find The First Instance of volume > 20 then Return the Age

Hi Jim the calculations works on mock data however not working with the sets I made in tableau

Not sure if sets can be used in the LOD?

Hi shin the 10 or 20 is a target this is not set in stone yet. The set col reference to actually sets in tableau as there 5 cols of data based on the data. So am using the sets to filter to data that should be counted.

Thanks Kev

• ###### 4. Re: LOD Find The First Instance of volume > 20 then Return the Age

see the images below - what were the expectations

this is set = in

this is set = out

and this is set = both

set is in the lod

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 5. Re: LOD Find The First Instance of volume > 20 then Return the Age

Hi Jim, thanks for your help.

The reason it's not working is due to my lack of knowledge in relation to sets.

I include the range in the dummy data however this is not in the data set.

I created sets in tableau across 5 columns with different conditions so referencing the set did not work in LOD as not calculated field in the data set or at least this is what I can tell from my experimentation.

I create a case statement referring to the sets, then added this to the the LOD you provided.

CASE [Condition Set] WHEN True THEN "In" ELSE "Out" END

• ###### 6. Re: LOD Find The First Instance of volume > 20 then Return the Age

Hi Kevin,

This can be done but I need to understand what you want to achieve. I'm not sure about the particular age you will like to return.

For example, using the image you posted in your original question, if Volume >10;

• Do you want to return Age 5 or 6 in Level One?
• Age 8 or 13 in Level Two?
• Age 1 or 9 in Level Three?
• Age 1 0r 18 in Level Four?

If you let me know what the expected result is for each of the four cases above, then I'll give you a solution.

Hope this helps.

Ossai

• ###### 7. Re: LOD Find The First Instance of volume > 20 then Return the Age

Oh never mind. I didn't refresh my browser before posting my last comment. It seems you've resolved the issue now.

• ###### 8. Re: LOD Find The First Instance of volume > 20 then Return the Age

Thanks Ossai, for offering to help. Not sure why thought the set would create a calculation. I have to say using sets making my life easier for updates.