Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to create a variable for each quarter ([Incident Quarter]) in a table (Incidents). For example, the most recent quarter would be $curr_Quarter, the previous quarter would be $curr_Quarter_min1, and $curr_Quarter_min2, etc. Any suggestions are welcomed. Thanks in advance!
Well how would you expect to use an unknown ("dynamic") number of variables?
I didn't understand how you were planning on using the variable in a table...
But yes that would work like you said with the loop. BTW, for consistency and reusability if you do it, max([Incident Quarter], 1) //max quarter can be used (no parameter defaults to 1)
You can leverage the 2nd parameter in max function
=max([Incident Quarter]) //max quarter
=max(Incident Quarter], 2) //second max incident
etc.
Thanks @stevejoyce . I think that'll help me get more than half way there! The number of quarters in the data set can vary so I want to keep the number of variables that I create dynamic. Would I need to first get the number of unique values, and write a loop to create the variables with the max function?
Well how would you expect to use an unknown ("dynamic") number of variables?
I didn't understand how you were planning on using the variable in a table...
But yes that would work like you said with the loop. BTW, for consistency and reusability if you do it, max([Incident Quarter], 1) //max quarter can be used (no parameter defaults to 1)
Thank you, worked!